| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
|
| 3 |
struct A |
| 4 |
{ |
| 5 |
int i; |
| 6 |
explicit A(int i): i(i) {} |
| 7 |
}; |
| 8 |
|
| 9 |
struct B: A |
| 10 |
{ |
| 11 |
using A::A; |
| 12 |
}; |
| 13 |
|
| 14 |
void f(B); |
| 15 |
|
| 16 |
int main() |
| 17 |
{ |
| 18 |
f(B(42)); // OK |
| 19 |
f(42); // { dg-error "could not convert" } |
| 20 |
} |