[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / adl.cpp
blob392ddddcb4ef7f605ab59ccf5f05264c1f3b4bb4
1 // RUN: %clang_cc1 -std=c++11 -verify %s
3 namespace PR40329 {
4 struct A {
5 A(int);
6 friend int operator->*(A, A);
7 };
8 struct B : A {
9 B();
10 enum E { e };
12 // Associated classes for B are {B, A}
13 // Associated classes for B::E are {B} (non-transitive in this case)
15 // If we search B::E first, we must not mark B "visited" and shortcircuit
16 // visiting it later, or we won't find the associated class A.
17 int k0 = B::e ->* B::e; // expected-error {{non-pointer-to-member type}}
18 int k1 = B::e ->* B();
19 int k2 = B() ->* B::e;