]> granicus.if.org Git - clang/commitdiff
Test instantiation of static data members that live within nested
authorDouglas Gregor <dgregor@apple.com>
Fri, 28 Aug 2009 21:41:19 +0000 (21:41 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 28 Aug 2009 21:41:19 +0000 (21:41 +0000)
member templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80396 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp
test/SemaTemplate/instantiate-member-template.cpp

index d72cea0907104362c2fbf9680ec66007921ac2be..fb25e99bc8927634affe9fc83f1489edf52c0e87 100644 (file)
@@ -808,9 +808,6 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
                                               const CXXScopeSpec &SS,
                                           TemplateParameterList **ParamLists,
                                               unsigned NumParamLists) {
-  // FIXME: This routine will need a lot more testing once we have support for
-  // member templates.
-  
   // Find the template-ids that occur within the nested-name-specifier. These
   // template-ids will match up with the template parameter lists.
   llvm::SmallVector<const TemplateSpecializationType *, 4>
index ebc3a5293f2bbbcbc2b874615b96c6f5e42f3afa..36f3b6fd490d396b82311c9b83d4590e4c853849 100644 (file)
@@ -63,8 +63,14 @@ template<typename U>
 struct X1<T>::Inner4 {
   template<typename V>
   V f2(T t, U u, V);
+  
+  static U value;
 };
 
+template<typename T>
+template<typename U>
+U X1<T>::Inner4<U>::value; // expected-error{{reference variable}}
+
 template<typename T>
 template<typename U>
 template<typename V>
@@ -93,4 +99,7 @@ void test_X1(int *ip, int i, double *dp) {
   
   X1<int*>::Inner4<int> id4;
   id4.f2(ip, i, dp); // expected-note{{instantiation}}
+  
+  X1<int*>::Inner4<int>::value = 17;
+  i = X1<int*>::Inner4<int&>::value; // expected-note{{instantiation}}
 }