Slightly tweak this condition. "isTransparentContext()" was checking whether an

enum is scoped or not, which is not relevant here. Instead, phrase the loop in
the same terms that the standard uses, instead of this awkward set of
conditions that is *nearly* equal.

llvm-svn: 152489
This commit is contained in:
Nick Lewycky 2012-03-10 07:47:07 +00:00
parent d9e1e57e2a
commit f604212a44
2 changed files with 6 additions and 2 deletions

View File

@ -8092,8 +8092,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// Find the context where we'll be declaring the tag.
// FIXME: We would like to maintain the current DeclContext as the
// lexical context,
while (SearchDC->isRecord() || SearchDC->isTransparentContext() ||
SearchDC->isObjCContainer())
while (!SearchDC->isFileContext() && !SearchDC->isFunctionOrMethod())
SearchDC = SearchDC->getParent();
// Find the scope where we'll be declaring the tag.

View File

@ -184,3 +184,8 @@ namespace PR12106 {
enum eCOLORS { Last };
Enum<eCOLORS> e;
}
namespace test7 {
enum class E { e = (struct S*)0 == (struct S*)0 };
S *p;
}