Patchwork [C++,testcase,committed] PR 57874

login
register
mail settings
Submitter Paolo Carlini
Date July 10, 2013, 5:47 p.m.
Message ID <51DD9E15.9030203@oracle.com>
Download mbox | patch
Permalink /patch/258177/
State New
Headers show

Comments

Paolo Carlini - July 10, 2013, 5:47 p.m.
Hi,

committed to mainline.

Thanks,
Paolo.

///////////////////////
2013-07-10  Paolo Carlini  <paolo.carlini@oracle.com>

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

Patch

Index: g++.dg/cpp0x/sfinae48.C
===================================================================
--- g++.dg/cpp0x/sfinae48.C	(revision 0)
+++ g++.dg/cpp0x/sfinae48.C	(working copy)
@@ -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, "");