111
|
1 // DR 1518
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 struct A {
|
|
5 explicit A() = default;
|
|
6 };
|
|
7
|
|
8 struct B : A {
|
|
9 explicit B() = default;
|
|
10 };
|
|
11
|
|
12 struct C {
|
|
13 explicit C();
|
|
14 };
|
|
15
|
|
16 struct D : A {
|
|
17 C c;
|
|
18 explicit D() = default;
|
|
19 };
|
|
20
|
|
21 template<typename T> void f() {
|
|
22 T t = {}; // { dg-error "explicit" }
|
|
23 }
|
|
24 template<typename T> void g() {
|
|
25 void x(T t);
|
|
26 x({}); // { dg-error "explicit" }
|
|
27 }
|
|
28
|
|
29 int main()
|
|
30 {
|
|
31 f<A>(); // { dg-message "required from here" }
|
|
32 f<B>(); // { dg-message "required from here" }
|
|
33 f<C>(); // { dg-message "required from here" }
|
|
34 f<D>(); // { dg-message "required from here" }
|
|
35
|
|
36 g<A>(); // { dg-message "required from here" }
|
|
37 g<B>(); // { dg-message "required from here" }
|
|
38 g<C>(); // { dg-message "required from here" }
|
|
39 g<D>(); // { dg-message "required from here" }
|
|
40 }
|