re PR c++/57874 (No SFINAE on ADL lookup failure)
2013-07-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57874 * g++.dg/cpp0x/sfinae48.C: New. From-SVN: r200880
This commit is contained in:
parent
d5e48350b4
commit
1fe62960d3
@ -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
|
||||
|
21
gcc/testsuite/g++.dg/cpp0x/sfinae48.C
Normal file
21
gcc/testsuite/g++.dg/cpp0x/sfinae48.C
Normal file
@ -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, "");
|
Loading…
Reference in New Issue
Block a user