diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/overload7.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/overload7.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload7.C b/gcc/testsuite/g++.old-deja/g++.other/overload7.C new file mode 100644 index 000000000..c028d5ea1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/overload7.C @@ -0,0 +1,23 @@ +// { dg-do run } +// Check that object call works when there are multiple conversion ops +// returning the same type. + +typedef int (*pfn)(); + +int zero () { return 0; } +int one () { return 1; } +int two () { return 2; } + +struct A { + A() { } + operator pfn () { return one; } + operator pfn () const { return zero; } + operator pfn () volatile { return two; } +}; + +int +main () +{ + const A a; + return a(); +} |