2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jul 2013 17:45:43 +0000 (17:45 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jul 2013 17:45:43 +0000 (17:45 +0000)
PR c++/57874
* g++.dg/cpp0x/sfinae48.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200880 138bc75d-0d04-0410-961f-82ee72b054a4

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

index cbe3ae0..7191eb5 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, "");