[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 09:14:47 PST 2020


aaron.ballman added inline comments.


================
Comment at: clang/test/Frontend/noderef.c:71
+  x = sizeof(s->a + (s->b)); // ok
+
   // Nested struct access
----------------
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
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91828



More information about the cfe-commits mailing list