summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-28 21:41:19 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-28 21:41:19 +0000
commit11395b66c6c59e8f68b4b00fc71aeacdd683911c (patch)
tree64c3f24ebf28ae48c95466e1ac1592a8bd78441f
parent5c58093178b3547ddf5d041e54d6ecc606e812b0 (diff)
downloadbcm5719-llvm-11395b66c6c59e8f68b4b00fc71aeacdd683911c.tar.gz
bcm5719-llvm-11395b66c6c59e8f68b4b00fc71aeacdd683911c.zip
Test instantiation of static data members that live within nested
member templates. llvm-svn: 80396
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp3
-rw-r--r--clang/test/SemaTemplate/instantiate-member-template.cpp9
2 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index d72cea09071..fb25e99bc89 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/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<const TemplateSpecializationType *, 4>
diff --git a/clang/test/SemaTemplate/instantiate-member-template.cpp b/clang/test/SemaTemplate/instantiate-member-template.cpp
index ebc3a5293f2..36f3b6fd490 100644
--- a/clang/test/SemaTemplate/instantiate-member-template.cpp
+++ b/clang/test/SemaTemplate/instantiate-member-template.cpp
@@ -63,10 +63,16 @@ 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>
V X1<T>::Inner4<U>::f2(T t, U u, V) {
return t + u; // expected-error{{incompatible type}}
@@ -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}}
}
OpenPOWER on IntegriCloud