From e9cccd86da2fe29b7488e4888fa09c6834c82f31 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 16 Jun 2010 08:42:20 +0000 Subject: Fix a point of semantics with using declaration hiding: method templates introduced by using decls are hidden even if their template parameter lists or return types differ from the "overriding" declaration. Propagate using shadow declarations around more effectively when looking up template-ids. Reperform lookup for template-ids in member expressions so that access control is properly set up. Fix some number of latent bugs involving template-ids with totally invalid base types. You can only actually get these with a scope specifier, since otherwise the template-id won't parse as a template-id. Fixes PR7384. llvm-svn: 106093 --- clang/test/SemaCXX/member-expr.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'clang/test/SemaCXX/member-expr.cpp') diff --git a/clang/test/SemaCXX/member-expr.cpp b/clang/test/SemaCXX/member-expr.cpp index 54a95936bed..e83fdbf0870 100644 --- a/clang/test/SemaCXX/member-expr.cpp +++ b/clang/test/SemaCXX/member-expr.cpp @@ -72,3 +72,21 @@ namespace test4 { y.f(17); } } + +namespace test5 { + struct A { + template void foo(); + }; + + void test0(int x) { + x.A::foo(); // expected-error {{'int' is not a structure or union}} + } + + void test1(A *x) { + x.A::foo(); // expected-error {{'test5::A *' is a pointer}} + } + + void test2(A &x) { + x->A::foo(); // expected-error {{'test5::A' is not a pointer}} + } +} -- cgit v1.2.3