diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-21 23:43:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-21 23:43:39 +0000 |
commit | 20c38a7c5870d300a4d713c13ac5e761d61d04d7 (patch) | |
tree | 8dbe947280a848c69a762ab51387ceb3c59e0b76 /clang/test/SemaTemplate/dependent-template-recover.cpp | |
parent | 53ff992dde7d169ab1334264d2c542478d6b3706 (diff) | |
download | bcm5719-llvm-20c38a7c5870d300a4d713c13ac5e761d61d04d7.tar.gz bcm5719-llvm-20c38a7c5870d300a4d713c13ac5e761d61d04d7.zip |
Improve recovery when we see a dependent template name that is missing
the required "template" keyword, using the same heuristics we do for
dependent template names in member access expressions, e.g.,
test/SemaTemplate/dependent-template-recover.cpp:11:8: error: use 'template'
keyword to treat 'getAs' as a dependent template name
T::getAs<U>();
^
template
Fixes PR5404.
llvm-svn: 104409
Diffstat (limited to 'clang/test/SemaTemplate/dependent-template-recover.cpp')
-rw-r--r-- | clang/test/SemaTemplate/dependent-template-recover.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-template-recover.cpp b/clang/test/SemaTemplate/dependent-template-recover.cpp index 632a11b2e06..e91ffb52539 100644 --- a/clang/test/SemaTemplate/dependent-template-recover.cpp +++ b/clang/test/SemaTemplate/dependent-template-recover.cpp @@ -8,6 +8,9 @@ struct X { t->operator+<U const, 1>(); // expected-error{{use 'template' keyword to treat 'operator +' as a dependent template name}} t->f1<int const, 2>(); // expected-error{{use 'template' keyword to treat 'f1' as a dependent template name}} + T::getAs<U>(); // expected-error{{use 'template' keyword to treat 'getAs' as a dependent template name}} + t->T::getAs<U>(); // expected-error{{use 'template' keyword to treat 'getAs' as a dependent template name}} + // FIXME: We can't recover from these yet (*t).f2<N>(); // expected-error{{expected expression}} (*t).f2<0>(); // expected-error{{expected expression}} |