1 // RUN: %clang_cc1 -std=c++14 -verify %s
2 // RUN: %clang_cc1 -std=c++14 -verify %s -DHAVE_UNQUALIFIED_LOOKUP_RESULTS
3 // expected-no-diagnostics
6 #ifdef HAVE_UNQUALIFIED_LOOKUP_RESULTS
11 template<typename T
> struct A
{
12 static constexpr auto x
= &T::value
;
15 template<typename T
> struct B
{
16 constexpr int operator&() { return 123; }
19 template<typename T
> struct C
{
20 static_assert(sizeof(T
) == 123, "");
28 friend constexpr int operator&(E
) { return 123; }
38 // ok, uses ADL to find operator&:
39 static_assert(A
<X1
>::x
== 123, "");
40 static_assert(A
<X2
>::x
== 123, "");
42 // ok, does not use ADL so does not instantiate C<T>:
43 static_assert(A
<Y1
>::x
== &Y1::value
, "");
44 static_assert(A
<Y2
>::x
== &Y2::value
, "");