diff options
Diffstat (limited to 'test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp')
-rw-r--r-- | test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp index 4c7ee94..51d61a5 100644 --- a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp +++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp @@ -22,3 +22,19 @@ namespace PR6264 { T bar = S(); } } + +namespace PR6066 { + struct B { }; + struct A : B { + operator B*(); + operator B&(); // expected-warning{{conversion function converting 'PR6066::A' to its base class 'PR6066::B' will never be used}} + }; + + void f(B&); // no rvalues accepted + void f(B*); + + int g() { + f(A()); // calls f(B*) + return 0; + } +} |