diff options
author | John McCall <rjmccall@apple.com> | 2010-11-29 18:01:58 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-29 18:01:58 +0000 |
commit | 032092ffc23a62549fd1bd9eb2d3dbd2247d13f9 (patch) | |
tree | 8c83cc09d8ea048f3c91ae812128dc96c7304b50 | |
parent | bbda8ed39a326343f75f135fab0103dd2f36fc69 (diff) | |
download | bcm5719-llvm-032092ffc23a62549fd1bd9eb2d3dbd2247d13f9.tar.gz bcm5719-llvm-032092ffc23a62549fd1bd9eb2d3dbd2247d13f9.zip |
Revert r120063, it was wrong.
llvm-svn: 120296
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 4 | ||||
-rw-r--r-- | clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp | 15 |
2 files changed, 5 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 648e654fd7d..d30faccf24a 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp index 5ba22c84191..466097171c8 100644 --- a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp +++ b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp @@ -82,7 +82,7 @@ namespace test2 { 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 @@ 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; - } } } |