diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-14 00:46:47 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-14 00:46:47 +0000 |
commit | 0d8dc460ae02e29d0b2abb4d6d093736e2f920ea (patch) | |
tree | 436c2fb3d20a8c7129be1c2bacd588d287dd71ff /test/CXX/class/class.mfct | |
parent | fb67ccd9da412d652d62e2ac9675b0f1b14fdc73 (diff) |
When creating an implicit member expression through a qualified-id, check that the class
named by the nested-name-specifier is same or base of the class in which the member expression appears.
It seems we also had an ill-formed test case, mon dieu! Fixes rdar://8576107.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/class/class.mfct')
-rw-r--r-- | test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp b/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp index c81e4ef1b1..9116e7146f 100644 --- a/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp +++ b/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp @@ -35,17 +35,22 @@ namespace test1 { struct A { void foo(Opaque1); // expected-note {{candidate}} void foo(Opaque2); // expected-note {{candidate}} - void test(); }; struct B : A { - + void test(); }; - void A::test() { - B::foo(Opaque1()); - B::foo(Opaque2()); - B::foo(Opaque3()); // expected-error {{no matching member function}} + struct C1 : A { }; + struct C2 : B { }; + + void B::test() { + A::foo(Opaque1()); + A::foo(Opaque2()); + A::foo(Opaque3()); // expected-error {{no matching member function}} + + C1::foo(Opaque1()); // expected-error {{call to non-static member function without an object argument}} + C2::foo(Opaque1()); // expected-error {{call to non-static member function without an object argument}} } } |