summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-static-var.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-27 17:43:39 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-27 17:43:39 +0000
commitd612997e732be3863fd613dda96c09ff3793c1f1 (patch)
tree4b0ed7a119c7fbed69cfcdaa6c2f41040a2328dd /clang/test/SemaTemplate/instantiate-static-var.cpp
parente48c85fa8be7ddb4ff296f6b95fedfed7747b1d1 (diff)
downloadbcm5719-llvm-d612997e732be3863fd613dda96c09ff3793c1f1.tar.gz
bcm5719-llvm-d612997e732be3863fd613dda96c09ff3793c1f1.zip
When instantiating a variable without an initializer, call
ActOnUninitializedDecl. llvm-svn: 77211
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-static-var.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-static-var.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-static-var.cpp b/clang/test/SemaTemplate/instantiate-static-var.cpp
index 99e6b9cc06c..ebf6658ba3a 100644
--- a/clang/test/SemaTemplate/instantiate-static-var.cpp
+++ b/clang/test/SemaTemplate/instantiate-static-var.cpp
@@ -16,3 +16,25 @@ class Y {
};
Y<float> fy; // expected-note{{in instantiation of template class 'class Y<float>' requested here}}
+
+
+// out-of-line static member variables
+
+template<typename T>
+struct Z {
+ static T value;
+};
+
+template<typename T>
+T Z<T>::value; // expected-error{{no matching constructor}}
+
+struct DefCon {};
+
+struct NoDefCon {
+ NoDefCon(const NoDefCon&);
+};
+
+void test() {
+ DefCon &DC = Z<DefCon>::value;
+ NoDefCon &NDC = Z<NoDefCon>::value; // expected-note{{instantiation}}
+} \ No newline at end of file
OpenPOWER on IntegriCloud