]> granicus.if.org Git - clang/commitdiff
Slightly tweak this condition. "isTransparentContext()" was checking whether an
authorNick Lewycky <nicholas@mxc.ca>
Sat, 10 Mar 2012 07:47:07 +0000 (07:47 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 10 Mar 2012 07:47:07 +0000 (07:47 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152489 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaCXX/enum-scoped.cpp

index 532767b64c3145f0781795de092bc83bf29a5b73..e3527a8289cc555703874bd6d79af3c47dbe95d0 100644 (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.
index 94cccb28fddf72450611ff6f13f5fc4e79db90cb..31190bebaa354bfd9425e1a4a7ac255465685d9d 100644 (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;
+}