sfinae38.C: New.
authorJason Merrill <jason@redhat.com>
Mon, 6 Aug 2012 10:25:22 +0000 (06:25 -0400)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 6 Aug 2012 10:25:22 +0000 (10:25 +0000)
2012-08-06  Jason Merrill  <jason@redhat.com>

* g++.dg/cpp0x/sfinae38.C: New.

From-SVN: r190176

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/sfinae38.C [new file with mode: 0644]

index 371acf198f338465c23f858539c6e4784c822a0f..b362c79dfb5149caacccf1857d49e72697f15d38 100644 (file)
@@ -1,3 +1,7 @@
+2012-08-06  Jason Merrill  <jason@redhat.com>
+
+       * g++.dg/cpp0x/sfinae38.C: New.
+
 2012-08-06  Marc Glisse  <marc.glisse@inria.fr>
            Paolo Carlini  <paolo.carlini@oracle.com>
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae38.C b/gcc/testsuite/g++.dg/cpp0x/sfinae38.C
new file mode 100644 (file)
index 0000000..2e860ee
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+
+template<class T, unsigned = sizeof(T)>
+auto f(int) -> char;
+
+template<class>
+auto f(...) -> char(&)[2];
+
+static_assert(sizeof(f<void>(0)) != 1, "");
+static_assert(sizeof(f<void()>(0)) != 1, "");