blob: e787f8bcbfb9ed698385d2b5f6334c1e27c9c9f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR152: explicit copy constructors
namespace N1 {
struct X {
X(); // { dg-message "note" }
explicit X(const X&);
};
void f(X); // { dg-message "initializing" }
int foo()
{
X x;
f(x); // { dg-error "matching" "matching" }
}
}
namespace N2 {
template <class T>
struct X {
X(); // { dg-message "note" }
explicit X(const X&);
};
template <class T>
void f(T) {} // { dg-message "initializing" }
template <class T>
int foo()
{
X<T> x;
N2::f(x); // { dg-error "matching" "matching" }
}
template int foo<float>(); // { dg-message "required from here" }
}
|