Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/sfinae48.C

raw
1 // PR c++/57874
2 // { dg-do compile { target c++11 } }
3
4 namespace NX
5 {
6 struct X {};
7 void foo(X) {}
8 }
9
10 namespace NY
11 {
12 struct Y {};
13 }
14
15 template<class T>
16 auto ADLfoo(T&&) -> decltype((foo(T{}), short()));
17
18 char ADLfoo(...);
19
20 static_assert(sizeof(ADLfoo(NY::Y{})) == 1, "");
21 static_assert(sizeof(ADLfoo(NX::X{})) == 2, "");