blob: ba728d9de8f3277a619aedc771078d959f5c2e7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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, "");
|