diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaObjCXX/message.mm | 6 | ||||
-rw-r--r-- | test/SemaTemplate/nested-name-spec-template.cpp | 2 | ||||
-rw-r--r-- | test/SemaTemplate/template-id-expr.cpp | 11 | ||||
-rw-r--r-- | test/SemaTemplate/typename-specifier-4.cpp | 3 | ||||
-rw-r--r-- | test/SemaTemplate/typename-specifier.cpp | 14 |
5 files changed, 19 insertions, 17 deletions
diff --git a/test/SemaObjCXX/message.mm b/test/SemaObjCXX/message.mm index 10b886b203..76bde6f57c 100644 --- a/test/SemaObjCXX/message.mm +++ b/test/SemaObjCXX/message.mm @@ -62,15 +62,15 @@ struct identity { // or typename-specifiers. if (false) { if (true) - return [typename identity<I3>::type method]; // expected-warning{{'typename' refers to a non-dependent type name; accepted as a C++0x extension}} + return [typename identity<I3>::type method]; // expected-warning{{occurs outside of a template}} return [::I3 method]; } int* ip1 = {[super method]}; int* ip2 = {[::I3 method]}; - int* ip3 = {[typename identity<I3>::type method]}; // expected-warning{{'typename' refers to a non-dependent type name; accepted as a C++0x extension}} - int* ip4 = {[typename identity<I2_holder>::type().get() method]}; // expected-warning{{'typename' refers to a non-dependent type name; accepted as a C++0x extension}} + int* ip3 = {[typename identity<I3>::type method]}; // expected-warning{{occurs outside of a template}} + int* ip4 = {[typename identity<I2_holder>::type().get() method]}; // expected-warning{{occurs outside of a template}} int array[5] = {[3] = 2}; return [super method]; } diff --git a/test/SemaTemplate/nested-name-spec-template.cpp b/test/SemaTemplate/nested-name-spec-template.cpp index e542507a2f..0251894f35 100644 --- a/test/SemaTemplate/nested-name-spec-template.cpp +++ b/test/SemaTemplate/nested-name-spec-template.cpp @@ -21,7 +21,7 @@ namespace N { } M::Promote<int>::type *ret_intptr3(int* ip) { return ip; } - M::template Promote<int>::type *ret_intptr4(int* ip) { return ip; } // expected-warning{{'template' refers to a non-dependent template name; accepted as a C++0x extension}} + M::template Promote<int>::type *ret_intptr4(int* ip) { return ip; } // expected-warning{{'template' keyword outside of a template}} } N::M::Promote<int>::type *ret_intptr5(int* ip) { return ip; } 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'}} diff --git a/test/SemaTemplate/typename-specifier-4.cpp b/test/SemaTemplate/typename-specifier-4.cpp index da11119e5b..5a313bf225 100644 --- a/test/SemaTemplate/typename-specifier-4.cpp +++ b/test/SemaTemplate/typename-specifier-4.cpp @@ -27,7 +27,8 @@ struct make_pair { int a0[is_same<metafun_apply2<make_pair, int, float>::type, pair<int, float> >::value? 1 : -1]; int a1[is_same< - typename make_pair::template apply<int, float>, // expected-warning{{'template' refers to a non-dependent template name}} + typename make_pair::template apply<int, float>, // expected-warning{{'template' keyword outside of a template}} \ + // expected-warning{{'typename' occurs outside of a template}} make_pair::apply<int, float> >::value? 1 : -1]; diff --git a/test/SemaTemplate/typename-specifier.cpp b/test/SemaTemplate/typename-specifier.cpp index e066475be9..4c788f6a8a 100644 --- a/test/SemaTemplate/typename-specifier.cpp +++ b/test/SemaTemplate/typename-specifier.cpp @@ -15,20 +15,22 @@ namespace N { int i; -typename N::A::type *ip1 = &i; // expected-warning{{'typename' refers to a non-dependent type name}} -typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'N::B'}} -typename N::C::type *ip3 = &i; // expected-error{{typename specifier refers to non-type member 'type'}} +typename N::A::type *ip1 = &i; // expected-warning{{'typename' occurs outside of a template}} +typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'N::B'}} \ +// expected-warning{{'typename' occurs outside of a template}} +typename N::C::type *ip3 = &i; // expected-error{{typename specifier refers to non-type member 'type'}} \ +// expected-warning{{'typename' occurs outside of a template}} void test(double d) { typename N::A::type f(typename N::A::type(a)); // expected-warning{{parentheses were disambiguated as a function declarator}} \ - // expected-warning 2{{'typename' refers to a non-dependent type name}} + // expected-warning 2{{'typename' occurs outside of a template}} int five = f(5); using namespace N; - for (typename A::type i = 0; i < 10; ++i) // expected-warning{{'typename' refers to a non-dependent type name}} + for (typename A::type i = 0; i < 10; ++i) // expected-warning{{'typename' occurs outside of a template}} five += 1; - const typename N::A::type f2(d); // expected-warning{{'typename' refers to a non-dependent type name}} + const typename N::A::type f2(d); // expected-warning{{'typename' occurs outside of a template}} } namespace N { |