aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-01 23:49:23 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-01 23:49:23 +0000
commit21d53e179651657e243587b79234fe6fedfae71c (patch)
tree67424f94a07d0c8a36f5e2e5be6da562358933f2
parentad5e73887052193afda72db8efcb812bd083a4a8 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97524 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Parse/ParseDeclCXX.cpp2
-rw-r--r--test/CXX/temp/temp.decls/temp.mem/p1.cpp19
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index bccfc6ad62..993ec3dfd4 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/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/test/CXX/temp/temp.decls/temp.mem/p1.cpp b/test/CXX/temp/temp.decls/temp.mem/p1.cpp
index 1b9da84886..b057eedf93 100644
--- a/test/CXX/temp/temp.decls/temp.mem/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.mem/p1.cpp
@@ -14,3 +14,22 @@ int foo() {
A<bool>::cond = true;
return A<bool>::B<int>::twice(4);
}
+
+namespace PR6376 {
+ template<typename T>
+ struct X {
+ template<typename Y>
+ struct Y { };
+ };
+
+ template<>
+ struct X<float> {
+ template<typename Y>
+ struct Y { };
+ };
+
+ template<typename T, typename U>
+ struct Z : public X<T>::template Y<U> { };
+
+ Z<float, int> z0;
+}