blob: f41dc2120abdfa51fe8913360da7a580b0be3a9e [file] [log] [blame]
Douglas Gregor2700dcd2009-09-02 23:58:38 +00001// RUN: clang-cc -fsyntax-only -verify %s
2// XFAIL
3template<typename T>
4void call_f0(T x) {
5 x.Base::f0();
6}
7
8struct Base {
9 void f0();
10};
11
12struct X0 : Base {
13 typedef Base CrazyBase;
14};
15
16void test_f0(X0 x0) {
17 call_f0(x0);
18}
19
20template<typename TheBase, typename T>
21void call_f0_through_typedef(T x) {
22 typedef TheBase Base2;
23 x.Base2::f0();
24}
25
26void test_f0_through_typedef(X0 x0) {
27 call_f0_through_typedef<Base>(x0);
28}
29
30template<typename TheBase, typename T>
31void call_f0_through_typedef2(T x) {
32 typedef TheBase CrazyBase; // expected-note{{current scope}}
33 x.CrazyBase::f0(); // expected-error{{ambiguous}}
34}
35
36struct OtherBase { };
37
38struct X1 : Base, OtherBase {
39 typedef OtherBase CrazyBase; // expected-note{{object type}}
40};
41
42void test_f0_through_typedef2(X0 x0, X1 x1) {
43 call_f0_through_typedef2<Base>(x0);
44 call_f0_through_typedef2<OtherBase>(x1);
45 call_f0_through_typedef2<Base>(x1); // expected-note{{here}}
46}
47
48