From 3cd4d1ece34d36317ec5352855d86e256cb6aa27 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 28 Aug 2009 21:41:19 +0000 Subject: [PATCH] Test instantiation of static data members that live within nested member templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80396 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplate.cpp | 3 --- test/SemaTemplate/instantiate-member-template.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index d72cea0907..fb25e99bc8 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -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 diff --git a/test/SemaTemplate/instantiate-member-template.cpp b/test/SemaTemplate/instantiate-member-template.cpp index ebc3a5293f..36f3b6fd49 100644 --- a/test/SemaTemplate/instantiate-member-template.cpp +++ b/test/SemaTemplate/instantiate-member-template.cpp @@ -63,8 +63,14 @@ template struct X1::Inner4 { template V f2(T t, U u, V); + + static U value; }; +template +template +U X1::Inner4::value; // expected-error{{reference variable}} + template template template @@ -93,4 +99,7 @@ void test_X1(int *ip, int i, double *dp) { X1::Inner4 id4; id4.f2(ip, i, dp); // expected-note{{instantiation}} + + X1::Inner4::value = 17; + i = X1::Inner4::value; // expected-note{{instantiation}} } -- 2.40.0