From 8a72621a019a0b3ae793b1f5fc6da2243476979f Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 29 Nov 2010 18:01:58 +0000 Subject: [PATCH] Revert r120063, it was wrong. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120296 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclCXX.cpp | 4 ++-- .../basic.namespace/namespace.udecl/p8.cpp | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 648e654fd7..d30faccf24 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3961,8 +3961,8 @@ bool Sema::CheckUsingDeclRedeclaration(SourceLocation UsingLoc, // 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 diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp index 5ba22c8419..466097171c 100644 --- a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp +++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp @@ -82,7 +82,7 @@ namespace test2 { template struct Derived; // 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 @@ namespace test3 { } 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; - } } } -- 2.40.0