1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 struct IntHolder
{ // expected-note 0-1{{here}} expected-note 2-4{{candidate constructor (the implicit}}
6 IntHolder(int); // expected-note 2{{candidate constructor}}
9 template<typename T
, typename U
>
10 struct X
{ // expected-note{{here}}
12 T t
; // expected-error{{no matching}}
18 #if __cplusplus >= 201103L
19 T value
; // expected-note {{has no default constructor}}
21 // expected-error@-4 {{implicit default}}
22 T value
; // expected-note {{member is declared here}}
29 template<typename T
, typename U
>
30 T X
<T
, U
>::value
; // expected-error{{no matching constructor}}
32 IntHolder
&test_X_IntHolderInt(X
<IntHolder
, int> xih
) {
34 xih
.f(); // expected-note{{instantiation}}
36 X
<IntHolder
, int>::Inner inner
;
37 #if __cplusplus >= 201103L
38 // expected-error@-2 {{call to implicitly-deleted}}
40 // expected-note@-4 {{first required here}}
43 return X
<IntHolder
, int>::value
; // expected-note{{instantiation}}
46 // Explicitly specialize the members of X<IntHolder, long> to not cause
47 // problems with instantiation.
49 void X
<IntHolder
, long>::f() { }
52 struct X
<IntHolder
, long>::Inner
{
53 Inner() : value(17) { }
58 IntHolder X
<IntHolder
, long>::value
= 17;
60 IntHolder
&test_X_IntHolderInt(X
<IntHolder
, long> xih
) {
62 xih
.f(); // okay, uses specialization
64 X
<IntHolder
, long>::Inner inner
; // okay, uses specialization
66 return X
<IntHolder
, long>::value
; // okay, uses specialization
70 X
<IntHolder
, long>::X() { } // expected-error{{instantiated member}}