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:
Paolo Carlini 2013-07-10 17:45:43 +00:00 committed by Paolo Carlini
parent d5e48350b4
commit 1fe62960d3
2 changed files with 26 additions and 0 deletions

View 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

View 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, "");