From af41696bc45c3a4e5e5a4e62f177e87b184eb5e7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 15 Nov 2012 00:31:27 +0000 Subject: Per [basic.lookup.classref]p3, in an expression of the form p->~type-name, the type-name is looked up in the context of the complete postfix-expression. Don't forget to pass the scope into this lookup when the type-name is a template-id; it might name an alias template which can't be found within the class itself. Bug spotted by Johannes Schaub on #llvm. llvm-svn: 168011 --- clang/test/SemaCXX/member-expr.cpp | 5 +++++ 1 file changed, 5 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 763f9c754c1..515bcd43b2c 100644 --- a/clang/test/SemaCXX/member-expr.cpp +++ b/clang/test/SemaCXX/member-expr.cpp @@ -111,8 +111,13 @@ namespace rdar8231724 { struct X { }; struct Y : X { }; + template struct Z { int n; }; + void f(Y *y) { y->N::X1; // expected-error{{'rdar8231724::N::X1' is not a member of class 'rdar8231724::Y'}} + y->Z::n; // expected-error{{'rdar8231724::Z::n' is not a member of class 'rdar8231724::Y'}} + y->template Z::n; // expected-error{{'rdar8231724::Z::n' is not a member of class 'rdar8231724::Y'}} \ + // expected-warning{{'template' keyword outside of a template}} } } -- cgit v1.2.3