[PATCH] D21675: New ODR checker for modules
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 17 09:53:25 PDT 2016
dblaikie added inline comments.
================
Comment at: lib/AST/DeclBase.cpp:1810-1812
@@ +1809,5 @@
+ void VisitNamedDecl(const NamedDecl *D) {
+ if (IdentifierInfo *II = D->getIdentifier()) {
+ ID.AddString(II->getName());
+ }
+ Inherited::VisitNamedDecl(D);
----------------
Inconsistent {} on single line block (in VisitEnumConstantDecl above {} are not used on a single line block) - usually drop the {} on single line blocks.
(several other instances in this patch)
================
Comment at: test/Modules/Inputs/odr_hash/first.h:5-8
@@ +4,6 @@
+
+struct S2Friend2 {};
+struct S2 {
+ friend S2Friend2;
+};
+
----------------
It might make this test more readable if all the types were in one file, maybe like this:
#ifdef FIRST
struct S2 { friend S2Friend1 };
#endif
struct S2 { friend S2Friend2 };
#endif
Etc... - and it could just be a textual header that the two headers include (one header #defines/#undefs the appropriate thing and one doesn't). But maybe that's too complicated - I'm not sure.
https://reviews.llvm.org/D21675
More information about the cfe-commits
mailing list