diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/template/sfinae-dr657.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/sfinae-dr657.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae-dr657.C b/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae-dr657.C new file mode 100644 index 000000000..b78b5a919 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae-dr657.C @@ -0,0 +1,22 @@ +// DR 657 +// Test that a return or parameter type with abstract class type causes a +// deduction failure. + +struct A +{ + A(); + A(int); + virtual void f() = 0; +}; + +template<class T> T declval(); +template<class T> int declval(...); + +template<class T> void arg(T); +template<class T> int arg(...); + +int main() +{ + int i = declval<A>(); + i = arg<A>(1); +} |