diff options
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/conversion/self1.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/conversion/self1.C b/gcc/testsuite/g++.dg/conversion/self1.C new file mode 100644 index 00000000000..f36500a9fa5 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/self1.C @@ -0,0 +1,15 @@ +// PR c++/31419 + +struct B +{ + template<typename T> + operator T const& () const + { + return 42; + } +}; + +B f() +{ + return B(); +} |