]> granicus.if.org Git - clang/commitdiff
When we're parsing template names as part of base-specifiers, we are
authorDouglas Gregor <dgregor@apple.com>
Mon, 1 Mar 2010 23:49:23 +0000 (23:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 1 Mar 2010 23:49:23 +0000 (23:49 +0000)
*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

lib/Parse/ParseDeclCXX.cpp
test/CXX/temp/temp.decls/temp.mem/p1.cpp

index bccfc6ad624ebf2b5b86170f05e2e5e2f0a4c62a..993ec3dfd456906db3d7755bfa6ea92a26668210 100644 (file)
@@ -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();
index 1b9da84886e79ea8c45fa26fb40db47281aee367..b057eedf93b41db97185baad65b1985a20f98440 100644 (file)
@@ -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;
+}