forked from OSchip/llvm-project
Test explicit specializations of static data members that are declarations, not definitions
llvm-svn: 83904
This commit is contained in:
parent
cc121aa750
commit
2210c9cd6e
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue