From d29f2799b7bc8f442b165960aed1a8d91b0acf19 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 1 Mar 2010 23:49:23 +0000 Subject: When we're parsing template names as part of base-specifiers, we are *not* entering the context of the nested-name-specifier. This was causing us to look into an uninstantiated template that we shouldn't look into. Fixes PR6376. llvm-svn: 97524 --- clang/lib/Parse/ParseDeclCXX.cpp | 2 +- clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'clang') diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index bccfc6ad624..993ec3dfd45 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1084,7 +1084,7 @@ Parser::BaseResult Parser::ParseBaseSpecifier(DeclPtrTy ClassDecl) { // Parse optional '::' and optional nested-name-specifier. CXXScopeSpec SS; - ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, true); + ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, false); // The location of the base class itself. SourceLocation BaseLoc = Tok.getLocation(); diff --git a/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp b/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp index 1b9da84886e..b057eedf93b 100644 --- a/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp @@ -14,3 +14,22 @@ int foo() { A::cond = true; return A::B::twice(4); } + +namespace PR6376 { + template + struct X { + template + struct Y { }; + }; + + template<> + struct X { + template + struct Y { }; + }; + + template + struct Z : public X::template Y { }; + + Z z0; +} -- cgit v1.2.3