summaryrefslogtreecommitdiff
path: root/test/SemaCXX/member-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/member-expr.cpp')
-rw-r--r--test/SemaCXX/member-expr.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp
index 54a95936bed16..6830c5fdafb77 100644
--- a/test/SemaCXX/member-expr.cpp
+++ b/test/SemaCXX/member-expr.cpp
@@ -72,3 +72,32 @@ 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}}
+ }
+}
+
+namespace PR7508 {
+ struct A {
+ struct CleanupScope {};
+ void PopCleanupBlock();
+ };
+
+ void foo(A &a) {
+ a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'}}
+ }
+}