Test explicit specializations of static data members that are declarations, not definitions

llvm-svn: 83904
This commit is contained in:
Douglas Gregor 2009-10-12 21:37:59 +00:00
parent cc121aa750
commit 2210c9cd6e
1 changed files with 22 additions and 0 deletions

View File

@ -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;
}