aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/template-id-expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-16 22:31:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-16 22:31:08 +0000
commit1a15dae8be2b28e02b6639aa92b832465c5be420 (patch)
treee0208461ea4e3d921f512bb2d2421ce2f983e7e0 /test/SemaTemplate/template-id-expr.cpp
parent13927a431dd733336cfd664bf0840747a71b0a43 (diff)
Fix the recently-added warning about 'typename' and 'template'
disambiguation keywords outside of templates in C++98/03. Previously, the warning would fire when the associated nested-name-specifier was not dependent, but that was a misreading of the C++98/03 standard: now, we complain only when we're outside of any template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/template-id-expr.cpp')
-rw-r--r--test/SemaTemplate/template-id-expr.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/SemaTemplate/template-id-expr.cpp b/test/SemaTemplate/template-id-expr.cpp
index e8974211b6..de8d7f6c91 100644
--- a/test/SemaTemplate/template-id-expr.cpp
+++ b/test/SemaTemplate/template-id-expr.cpp
@@ -62,12 +62,12 @@ struct Y0 {
template<typename U>
void f() {
- Y0::template f1<U>(0); // expected-warning{{'template' refers to a non-dependent template name}}
- Y0::template f1(0); // expected-warning{{'template' refers to a non-dependent template name}}
+ Y0::template f1<U>(0);
+ Y0::template f1(0);
this->template f1(0);
- Y0::template f2<U>(0); // expected-warning{{'template' refers to a non-dependent template name}}
- Y0::template f2(0);// expected-warning{{'template' refers to a non-dependent template name}}
+ Y0::template f2<U>(0);
+ Y0::template f2(0);
Y0::template f3(0); // expected-error {{'f3' following the 'template' keyword does not refer to a template}}
Y0::template f3(); // expected-error {{'f3' following the 'template' keyword does not refer to a template}}
@@ -75,8 +75,7 @@ struct Y0 {
int x;
x = Y0::f4(0);
x = Y0::f4<int>(0); // expected-error {{assigning to 'int' from incompatible type 'void'}}
- x = Y0::template f4(0); // expected-error {{assigning to 'int' from incompatible type 'void'}} \
- // expected-warning{{'template' refers to a non-dependent template name}}
+ x = Y0::template f4(0); // expected-error {{assigning to 'int' from incompatible type 'void'}}
x = this->f4(0);
x = this->f4<int>(0); // expected-error {{assigning to 'int' from incompatible type 'void'}}