[cfe-commits] r97524 - in /cfe/trunk: lib/Parse/ParseDeclCXX.cpp test/CXX/temp/temp.decls/temp.mem/p1.cpp
Douglas Gregor
dgregor at apple.com
Mon Mar 1 15:49:23 PST 2010
Author: dgregor
Date: Mon Mar 1 17:49:23 2010
New Revision: 97524
URL: http://llvm.org/viewvc/llvm-project?rev=97524&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p1.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=97524&r1=97523&r2=97524&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon Mar 1 17:49:23 2010
@@ -1084,7 +1084,7 @@
// 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();
Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p1.cpp?rev=97524&r1=97523&r2=97524&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p1.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p1.cpp Mon Mar 1 17:49:23 2010
@@ -14,3 +14,22 @@
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;
+}
More information about the cfe-commits
mailing list