From d612997e732be3863fd613dda96c09ff3793c1f1 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 27 Jul 2009 17:43:39 +0000 Subject: When instantiating a variable without an initializer, call ActOnUninitializedDecl. llvm-svn: 77211 --- clang/test/SemaTemplate/instantiate-static-var.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'clang/test/SemaTemplate/instantiate-static-var.cpp') 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 fy; // expected-note{{in instantiation of template class 'class Y' requested here}} + + +// out-of-line static member variables + +template +struct Z { + static T value; +}; + +template +T Z::value; // expected-error{{no matching constructor}} + +struct DefCon {}; + +struct NoDefCon { + NoDefCon(const NoDefCon&); +}; + +void test() { + DefCon &DC = Z::value; + NoDefCon &NDC = Z::value; // expected-note{{instantiation}} +} \ No newline at end of file -- cgit v1.2.3