steakhal added a comment.

In D114256#3149009 <https://reviews.llvm.org/D114256#3149009>, @martong wrote:

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

The matcher `recordDecl(isStruct(), **isDefinition()**, 
unless(isExpansionInSystemHeader()))` filters that case.

Thanks for the review @martong!



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


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