rsmith added inline comments.

================
Comment at: lib/AST/DeclBase.cpp:1704-1705
+
+  // In C, the redeclaration context for enumerators is the translation unit,
+  // so we skip through transparent contexts as well as struct/union contexts.
+  bool SkipRecords = getDeclKind() == Decl::Kind::Enum &&
----------------
Nit: "the redeclaration context for enumerators is the translation unit" is not 
entirely accurate. The point instead is that a record type is only the 
redeclaration context for the fields of that record, so if we arrive at that 
context after skipping anything else, we should skip the record as well. (The 
check for "Enum" here is a red herring in that regard, but it happens to be 
correct because enumerations are the only transparent context that can exist 
within a struct or union currently.)


https://reviews.llvm.org/D52384



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D52384: [... Aaron Ballman via Phabricator via cfe-commits
    • [PATCH] D523... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D523... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D523... Aaron Ballman via Phabricator via cfe-commits

Reply via email to