diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-15 00:31:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-15 00:31:27 +0000 |
commit | af41696bc45c3a4e5e5a4e62f177e87b184eb5e7 (patch) | |
tree | bc8e1cca26b3c7221c68dca0bf03174ac42cf0ee /clang/test/SemaCXX/member-expr.cpp | |
parent | 37feb2d6a65f84baa4c299871636a49a8e3a8eb9 (diff) | |
download | bcm5719-llvm-af41696bc45c3a4e5e5a4e62f177e87b184eb5e7.tar.gz bcm5719-llvm-af41696bc45c3a4e5e5a4e62f177e87b184eb5e7.zip |
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
Diffstat (limited to 'clang/test/SemaCXX/member-expr.cpp')
-rw-r--r-- | clang/test/SemaCXX/member-expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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<typename T> struct Z { int n; }; + void f(Y *y) { y->N::X1<int>; // expected-error{{'rdar8231724::N::X1' is not a member of class 'rdar8231724::Y'}} + y->Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'rdar8231724::Y'}} + y->template Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'rdar8231724::Y'}} \ + // expected-warning{{'template' keyword outside of a template}} } } |