aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-12 21:37:59 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-12 21:37:59 +0000
commit65f6642e88ac39f2c1129f9b92b3fafd55dc32df (patch)
tree7116f63cfc76821d418dc9db3865fb94d5dac8f1
parent27c8235def85fc7f92fcaffe7907eef0552ca209 (diff)
Test explicit specializations of static data members that are declarations, not definitions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83904 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp
new file mode 100644
index 0000000000..840f566362
--- /dev/null
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+struct NonDefaultConstructible {
+ NonDefaultConstructible(const NonDefaultConstructible&);
+};
+
+template<typename T, typename U>
+struct X {
+ static T member;
+};
+
+template<typename T, typename U>
+T X<T, U>::member; // expected-error{{no matching constructor}}
+
+// Okay; this is a declaration, not a definition.
+template<>
+NonDefaultConstructible X<NonDefaultConstructible, long>::member;
+
+NonDefaultConstructible &test(bool b) {
+ return b? X<NonDefaultConstructible, int>::member // expected-note{{instantiation}}
+ : X<NonDefaultConstructible, long>::member;
+}