thejh added inline comments.

================
Comment at: clang/test/Frontend/noderef.c:71
+  x = sizeof(s->a + (s->b)); // ok
+
   // Nested struct access
----------------
aaron.ballman wrote:
> Can you add tests for the weird situations where the expression actually is 
> evaluated? e.g.,
> ```
> struct S {
>   virtual ~S(); // Make S polymorphic
> };
> 
> S NODEREF *s;
> typeid(*s); // Actually evaluates *s at runtime
> 
> struct T {
>   unsigned i;
> };
> 
> T t1;
> T NODEREF *t2 = &t1;
> 
> sizeof(int[++t2->i]); // Actually evaluates t2->i at runtime
> ```
Oh jeez, good point. I'm extremely happy that other people have done the hard 
work of building the `ExpressionEvaluationContext` logic... I've added tests 
for the cases you described.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91828/new/

https://reviews.llvm.org/D91828

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to