[PATCH] D78085: [AST] Fix recovery-expr crash on invalid aligned attr.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 12:58:23 PDT 2020


sammccall added inline comments.


================
Comment at: clang/lib/AST/DeclBase.cpp:400
+  for (; I != E; ++I) {
+    if (!I->isAlignmentDependent())
+      Align = std::max(Align, I->getAlignment(Ctx));
----------------
This doesn't seem great - previously if e.g. codegen ends up needing the alignment of a dependent decl somehow, then an assert will catch that programming error.
Now it'll be silently swallowed. Seems better to check isAlignmentErrorDependent() here (you'd need to add that function) and continue to assert in other dependent cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78085





More information about the cfe-commits mailing list