martong added a comment.

What happens if this checker runs on a forward declared class?

  struct Foo;

I'd expect the pack/alignment info is missing also in that case.



================
Comment at: clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp:54
 
+  // Ignore invalid decls to prevent crashing on calling `getASTRecordLayout`.
+  if (Struct->isInvalidDecl())
----------------
I'd mention first that packing and alignment info are meaningless for invalid 
declarations.


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

https://reviews.llvm.org/D114256

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

Reply via email to