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
diff --git a/test/SemaTemplate/template-id-expr.cpp b/test/SemaTemplate/template-id-expr.cpp
index e897421..de8d7f6 100644
--- a/test/SemaTemplate/template-id-expr.cpp
+++ b/test/SemaTemplate/template-id-expr.cpp
@@ -62,12 +62,12 @@
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 @@
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'}}