Hi,
I committed the testcase provided by Daniel in c++/48735 and closed the
PR as already fixed. Also took the occasion to move my recent c++0x
testcases to the proper cpp0x directory.
Tested x86_64-linux.
Paolo.
////////////////////////
2011-05-09 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/48735
* g++.dg/cpp0x/sfinae21.C: New.
2011-05-09 Paolo Carlini <paolo.carl...@oracle.com>
* g++.dg/template/sfinae28.C: Rename to...
* g++.dg/cpp0x/sfinae19.C: ... this.
* g++.dg/template/sfinae29.C: Rename to...
* g++.dg/cpp0x/sfinae20.C: ... this.
Index: g++.dg/cpp0x/sfinae21.C
===================================================================
--- g++.dg/cpp0x/sfinae21.C (revision 0)
+++ g++.dg/cpp0x/sfinae21.C (revision 0)
@@ -0,0 +1,14 @@
+// PR c++/48735
+// { dg-options "-std=c++0x" }
+
+template<class T,
+ class = decltype(T{})
+>
+char f(int);
+
+template<class>
+char (&f(...))[2];
+
+struct ND { ND() = delete; };
+
+static_assert(sizeof(f<ND[1]>(0)) != 1, "Error");
Index: g++.dg/template/sfinae28.C
===================================================================
--- g++.dg/template/sfinae28.C (revision 173596)
+++ g++.dg/template/sfinae28.C (working copy)
@@ -1,13 +0,0 @@
-// PR c++/48737
-// { dg-options "-std=c++0x" }
-
-template<class T>
-T&& create();
-
-template<class T, class... Args>
-decltype(T{create<Args>()...}, char()) f(int);
-
-template<class, class...>
-char (&f(...))[2];
-
-static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
Index: g++.dg/template/sfinae29.C
===================================================================
--- g++.dg/template/sfinae29.C (revision 173596)
+++ g++.dg/template/sfinae29.C (working copy)
@@ -1,23 +0,0 @@
-// PR c++/48744
-// { dg-options "-std=c++0x" }
-
-template<class T>
-struct add_rval_ref {
- typedef T&& type;
-};
-
-template<>
-struct add_rval_ref<void> {
- typedef void type;
-};
-
-template<class T>
-typename add_rval_ref<T>::type create();
-
-template<class T, class Arg>
-decltype(T{create<Arg>()}, char()) f(int);
-
-template<class, class>
-char (&f(...))[2];
-
-static_assert(sizeof(f<int, void>(0)) != 1, "Error");