re PR c++/57874 (No SFINAE on ADL lookup failure)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 10 Jul 2013 17:45:43 +0000 (17:45 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 10 Jul 2013 17:45:43 +0000 (17:45 +0000)
2013-07-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/57874
* g++.dg/cpp0x/sfinae48.C: New.

From-SVN: r200880

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

index cbe3ae02b1bdeee1de49eb8ca3614c618e9ea147..7191eb507dd2a06ddf8b1b88f4718bb5344c297f 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/57874
+       * g++.dg/cpp0x/sfinae48.C: New.
+
 2013-07-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR preprocessor/57824
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae48.C b/gcc/testsuite/g++.dg/cpp0x/sfinae48.C
new file mode 100644 (file)
index 0000000..ba728d9
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/57874
+// { dg-do compile { target c++11 } }
+
+namespace NX
+{
+  struct X {};
+  void foo(X) {}
+}
+
+namespace NY
+{
+  struct Y {};
+}
+
+template<class T>
+auto ADLfoo(T&&) -> decltype((foo(T{}), short()));
+
+char ADLfoo(...);
+
+static_assert(sizeof(ADLfoo(NY::Y{})) == 1, "");
+static_assert(sizeof(ADLfoo(NX::X{})) == 2, "");