summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r--clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
index 6471cd84183..2e1c9a43969 100644
--- a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
+++ b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
@@ -379,3 +379,19 @@ int main() {
} // end ns PR24473
#endif // CPP1Y
+
+namespace dependent_static_var_template {
+ struct A {
+ template<int = 0> static int n; // expected-note {{here}}
+ };
+ int &r = A::template n; // FIXME: ill-formed
+
+ template<typename T>
+ int &f() { return T::template n; } // expected-error {{use of variable template 'n' requires template arguments}}
+ int &s = f<A>(); // expected-note {{instantiation of}}
+
+ namespace B {
+ template<int = 0> static int n;
+ }
+ int &t = B::template n; // FIXME: ill-formed
+}
OpenPOWER on IntegriCloud