Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/overload-conv-4.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion. | |
2 // { dg-do compile { target c++11 } } | |
3 // { dg-options "-Wconversion" } | |
4 | |
5 struct B; | |
6 | |
7 struct A { | |
8 operator B(); | |
9 }; | |
10 | |
11 struct B { | |
12 B(A const &rs); | |
13 B(B const &rs); | |
14 }; | |
15 | |
16 B | |
17 f (A x) | |
18 { | |
19 // C++14: we call B::B(A const &) | |
20 // C++17: we call A::operator B() | |
21 return B(x); // { dg-warning "choosing .A::operator B\\(\\). over .B::B\\(const A&\\)" "" { target c++17 } } | |
22 // { dg-warning "for conversion from .A. to .B." "" { target c++17 } .-1 } | |
23 } |