[cfe-commits] r120296 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp

John McCall rjmccall at apple.com
Mon Nov 29 10:01:59 PST 2010


Author: rjmccall
Date: Mon Nov 29 12:01:58 2010
New Revision: 120296

URL: http://llvm.org/viewvc/llvm-project?rev=120296&view=rev
Log:
Revert r120063, it was wrong.


Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=120296&r1=120295&r2=120296&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Nov 29 12:01:58 2010
@@ -3961,8 +3961,8 @@
   //   repeatedly where (and only where) multiple declarations are
   //   allowed.
   //
-  // That's in file contexts.
-  if (CurContext->isFileContext())
+  // That's in non-member contexts.
+  if (!CurContext->getRedeclContext()->isRecord())
     return false;
 
   NestedNameSpecifier *Qual

Modified: cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp?rev=120296&r1=120295&r2=120296&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp (original)
+++ cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp Mon Nov 29 12:01:58 2010
@@ -82,7 +82,7 @@
   template struct Derived<int>; // expected-note {{in instantiation of template class}}
 }
 
-// PR8668: redeclarations are not okay in a function.
+// Redeclarations are okay in a function.
 namespace test3 {
   namespace N {
     int f(int);
@@ -90,18 +90,9 @@
   }
 
   void g() {
-    using N::f; // expected-note {{previous using declaration}}
-    using N::f; // expected-error {{redeclaration of using decl}}
-    using N::type; // expected-note {{previous using declaration}}
-    using N::type; // expected-error {{redeclaration of using decl}}
-  }
-
-  void h() {
     using N::f;
+    using N::f;
+    using N::type;
     using N::type;
-    {
-      using N::f;
-      using N::type;
-    }
   }
 }





More information about the cfe-commits mailing list