aaron.ballman closed this revision.
aaron.ballman added a comment.
Committed (with improved comment) in r345073.
https://reviews.llvm.org/D52384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/c
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::K
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
(Looks fine with a suitably-adjusted comment.)
https://reviews.llvm.org/D52384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lis
aaron.ballman added a comment.
Ping
https://reviews.llvm.org/D52384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaron.ballman added inline comments.
Comment at: lib/AST/DeclBase.cpp:1711-1712
+ // contexts are always skipped.
+ while (SkipRecords ? Ctx->isTransparentContext() || Ctx->isRecord()
+ : Ctx->isTransparentContext())
Ctx = Ctx->getParent();
aaron.ballman updated this revision to Diff 167496.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.
Herald added a subscriber: jsji.
Updated based on review feedback.
https://reviews.llvm.org/D52384
Files:
lib/AST/DeclBase.cpp
test/Sema/enum.c
Index: test/Se
majnemer added inline comments.
Comment at: lib/AST/DeclBase.cpp:1711-1712
+ // contexts are always skipped.
+ while (SkipRecords ? Ctx->isTransparentContext() || Ctx->isRecord()
+ : Ctx->isTransparentContext())
Ctx = Ctx->getParent();
aaron.ballman added a reviewer: echristo.
aaron.ballman added a comment.
Ping?
https://reviews.llvm.org/D52384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaron.ballman created this revision.
aaron.ballman added reviewers: rsmith, dblaikie.
In C, enumerators are not hoisted into, say, a struct decl context when the
enumeration is declared inside of a struct. Instead, the enumerators are
hoisted into the translation unit decl context. This patch fi