blob: f8a01d5fff2ae1e11dfdbb2f6e945fc4b88f07dc [file] [log] [blame]
Douglas Gregordd8c10f2010-10-22 17:36:51 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// PR8439
4class A
5{
6};
7
8class B
9{
10public:
11 A & m;
12};
13
14class Base
15{
16public:
17 B &f();
18};
19
20class Derived1 : public Base { };
21
22class Derived2 : public Base { };
23
24class X : public B, public Derived2, public Derived1
25{
26public:
27 virtual void g();
28};
29
30void X::g()
31{
32 m.f<int>(); // expected-error{{no member named 'f' in 'A'}} \
33 // expected-error{{expected '(' for function-style cast}} \
34 // expected-error{{expected expression}}
35}
Douglas Gregor95e55102011-10-21 15:47:52 +000036
37namespace PR11134 {
38 template<typename Derived> class A;
39 template<typename Derived> class B : A<Derived> {
40 typedef A<Derived> Base;
41 using Base::member;
42 int member;
43 };
44}
45