summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/member-expr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-06-16 08:42:20 +0000
committerJohn McCall <rjmccall@apple.com>2010-06-16 08:42:20 +0000
commite9cccd86da2fe29b7488e4888fa09c6834c82f31 (patch)
tree5a7b17c3fc2c082838d3ecae813af472a552eab5 /clang/test/SemaCXX/member-expr.cpp
parentf128bdcb557e20b20d02ca0351aa4ff19a1b0c42 (diff)
downloadbcm5719-llvm-e9cccd86da2fe29b7488e4888fa09c6834c82f31.tar.gz
bcm5719-llvm-e9cccd86da2fe29b7488e4888fa09c6834c82f31.zip
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
Diffstat (limited to 'clang/test/SemaCXX/member-expr.cpp')
-rw-r--r--clang/test/SemaCXX/member-expr.cpp18
1 files changed, 18 insertions, 0 deletions
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 <class T> void foo();
+ };
+
+ void test0(int x) {
+ x.A::foo<int>(); // expected-error {{'int' is not a structure or union}}
+ }
+
+ void test1(A *x) {
+ x.A::foo<int>(); // expected-error {{'test5::A *' is a pointer}}
+ }
+
+ void test2(A &x) {
+ x->A::foo<int>(); // expected-error {{'test5::A' is not a pointer}}
+ }
+}
OpenPOWER on IntegriCloud