Commit 0621f7c2 by Janis Johnson Committed by Janis Johnson

auto27.C: Add comments to checks for multiple messages reported for one line of source code.

	* g++.dg/cpp0x/auto27.C: Add comments to checks for multiple
	messages reported for one line of source code.
	* g++.dg/cpp0x/constexpr-decl.C: Likewise.
	* g++.dg/cpp0x/decltype2.C: Likewise.
	* g++.dg/cpp0x/decltype3.C: Likewise.
	* g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise.
	* g++.dg/cpp0x/regress/error-recovery1.C: Likewise.
	* g++.dg/cpp0x/static_assert3.C: Likewise.
	* g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise.
	* g++.dg/cpp0x/udlit-shadow-neg.C: Likewise.
	* g++.dg/cpp0x/union1.C: Likewise.
	* g++.dg/cpp0x/variadic-ex10.C: Likewise.
	* g++.dg/cpp0x/variadic-ex14.C: Likewise.
	* g++.dg/cpp0x/variadic2.C: Likewise.
	* g++.dg/cpp0x/variadic20.C: Likewise.
	* g++.dg/cpp0x/variadic74.C: Likewise.
	* g++.dg/diagnostic/bitfld2.C: Likewise.
	* g++.dg/ext/attrib44.C: Likewise.
	* g++.dg/ext/no-asm-1.C: Likewise.
	* g++.dg/other/error34.C: Likewise.
	* g++.dg/parse/crash46.C: Likewise.
	* g++.dg/parse/error10.C: Likewise.
	* g++.dg/parse/error2.C: Likewise.
	* g++.dg/parse/error3.C: Likewise.
	* g++.dg/parse/error36.C: Likewise.
	* g++.dg/parse/error8.C: Likewise.
	* g++.dg/parse/error9.C: Likewise.
	* g++.dg/parse/parser-pr28152-2.C: Likewise.
	* g++.dg/parse/parser-pr28152.C: Likewise.
	* g++.dg/parse/template25.C: Likewise.
	* g++.dg/parse/typename11.C: Likewise.
	* g++.dg/tc1/dr147.C: Likewise.
	* g++.dg/template/deduce3.C: Likewise.
	* g++.dg/template/koenig9.C: Likewise.
	* g++.dg/template/pr23510.C: Likewise.
	* g++.dg/warn/pr12242.C: Likewise.
	* g++.dg/warn/pr30551-2.C: Likewise.
	* g++.dg/warn/pr30551.C: Likewise.
	* g++.old-deja/g++.other/typename1.C: Likewise.
	* g++.old-deja/g++.pt/niklas01a.C: Likewise.

From-SVN: r188677
parent ad14c7da
2012-06-15 Janis Johnson <janosjo@codesourcery.com>
* g++.dg/cpp0x/auto27.C: Add comments to checks for multiple
messages reported for one line of source code.
* g++.dg/cpp0x/constexpr-decl.C: Likewise.
* g++.dg/cpp0x/decltype2.C: Likewise.
* g++.dg/cpp0x/decltype3.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise.
* g++.dg/cpp0x/regress/error-recovery1.C: Likewise.
* g++.dg/cpp0x/static_assert3.C: Likewise.
* g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise.
* g++.dg/cpp0x/udlit-shadow-neg.C: Likewise.
* g++.dg/cpp0x/union1.C: Likewise.
* g++.dg/cpp0x/variadic-ex10.C: Likewise.
* g++.dg/cpp0x/variadic-ex14.C: Likewise.
* g++.dg/cpp0x/variadic2.C: Likewise.
* g++.dg/cpp0x/variadic20.C: Likewise.
* g++.dg/cpp0x/variadic74.C: Likewise.
* g++.dg/diagnostic/bitfld2.C: Likewise.
* g++.dg/ext/attrib44.C: Likewise.
* g++.dg/ext/no-asm-1.C: Likewise.
* g++.dg/other/error34.C: Likewise.
* g++.dg/parse/crash46.C: Likewise.
* g++.dg/parse/error10.C: Likewise.
* g++.dg/parse/error2.C: Likewise.
* g++.dg/parse/error3.C: Likewise.
* g++.dg/parse/error36.C: Likewise.
* g++.dg/parse/error8.C: Likewise.
* g++.dg/parse/error9.C: Likewise.
* g++.dg/parse/parser-pr28152-2.C: Likewise.
* g++.dg/parse/parser-pr28152.C: Likewise.
* g++.dg/parse/template25.C: Likewise.
* g++.dg/parse/typename11.C: Likewise.
* g++.dg/tc1/dr147.C: Likewise.
* g++.dg/template/deduce3.C: Likewise.
* g++.dg/template/koenig9.C: Likewise.
* g++.dg/template/pr23510.C: Likewise.
* g++.dg/warn/pr12242.C: Likewise.
* g++.dg/warn/pr30551-2.C: Likewise.
* g++.dg/warn/pr30551.C: Likewise.
* g++.old-deja/g++.other/typename1.C: Likewise.
* g++.old-deja/g++.pt/niklas01a.C: Likewise.
2012-06-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> 2012-06-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
PR c++/51033 PR c++/51033
......
// PR c++/51186 // PR c++/51186
auto main()->int // { dg-error "std=" "" { target c++98 } } auto main()->int // { dg-error "std=" "std" { target c++98 } }
// { dg-error "auto" "" { target c++98 } 3 } // { dg-error "auto" "auto" { target c++98 } 3 }
// { dg-error "no type" "" { target c++98 } 3 } // { dg-error "no type" "no type" { target c++98 } 3 }
{ } { }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// { dg-options -std=c++0x } // { dg-options -std=c++0x }
struct S { struct S {
static constexpr int size; // { dg-error "must have an initializer" } static constexpr int size; // { dg-error "must have an initializer" "must have" }
// { dg-error "previous declaration" "" { target *-*-* } 5 } // { dg-error "previous declaration" "previous" { target *-*-* } 5 }
}; };
const int limit = 2 * S::size; const int limit = 2 * S::size;
......
...@@ -45,8 +45,8 @@ int bar(char); ...@@ -45,8 +45,8 @@ int bar(char);
int bar(int); int bar(int);
CHECK_DECLTYPE(decltype(foo), int(char)); CHECK_DECLTYPE(decltype(foo), int(char));
decltype(bar) z; // { dg-error "overload" } decltype(bar) z; // { dg-error "overload" "overload" }
// { dg-error "invalid type" "" { target *-*-* } 48 } // { dg-error "invalid type" "invalid" { target *-*-* } 48 }
CHECK_DECLTYPE(decltype(&foo), int(*)(char)); CHECK_DECLTYPE(decltype(&foo), int(*)(char));
CHECK_DECLTYPE(decltype(*&foo), int(&)(char)); CHECK_DECLTYPE(decltype(*&foo), int(&)(char));
......
...@@ -55,8 +55,8 @@ public: ...@@ -55,8 +55,8 @@ public:
}; };
CHECK_DECLTYPE(decltype(aa.*&A::a), int&); CHECK_DECLTYPE(decltype(aa.*&A::a), int&);
decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" } decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" "cannot" }
// { dg-error "invalid type" "" { target *-*-* } 58 } // { dg-error "invalid type" "invalid type" { target *-*-* } 58 }
CHECK_DECLTYPE(decltype(caa.*&A::a), const int&); CHECK_DECLTYPE(decltype(caa.*&A::a), const int&);
class X { class X {
......
// PR c++/46124 // PR c++/46124
// { dg-options -std=c++0x } // { dg-options -std=c++0x }
void foo() { [] () -> void (); } // { dg-error "returning a function" } void foo() { [] () -> void (); } // { dg-error "returning a function" "returning" }
// { dg-error "expected .\{" "" { target *-*-* } 4 } // { dg-error "expected .\{" "expected" { target *-*-* } 4 }
...@@ -5,7 +5,7 @@ template < bool > void ...@@ -5,7 +5,7 @@ template < bool > void
foo () foo ()
{ {
const bool b =; // { dg-error "" } const bool b =; // { dg-error "" }
foo < b > (); // { dg-error "constant expression" } foo < b > (); // { dg-error "constant expression" "const expr" }
}; };
// { dg-error "no match" "" { target *-*-* } 8 } // { dg-error "no match" "no match" { target *-*-* } 8 }
// { dg-options "-std=c++0x" } // { dg-options "-std=c++0x" }
static_assert(7 / 0, "X"); // { dg-error "non-constant condition" } static_assert(7 / 0, "X"); // { dg-error "non-constant condition" "non-constant" }
// { dg-warning "division by zero" "" { target *-*-* } 2 } // { dg-warning "division by zero" "zero" { target *-*-* } 2 }
// { dg-error "7 / 0.. is not a constant expression" "" { target *-*-* } 2 } // { dg-error "7 / 0.. is not a constant expression" "not a constant" { target *-*-* } 2 }
...@@ -12,6 +12,6 @@ int ...@@ -12,6 +12,6 @@ int
operator"" _Q(const char *, std::size_t) // { dg-warning "user-defined literals only available with" } operator"" _Q(const char *, std::size_t) // { dg-warning "user-defined literals only available with" }
{ return 42; } { return 42; }
int x = "Hello"_Q; // { dg-error "invalid conversion from" } int x = "Hello"_Q; // { dg-error "invalid conversion from" "invalid" }
// { dg-error "expected" "" { target *-*-* } 15 } // { dg-error "expected" "expected" { target *-*-* } 15 }
...@@ -39,11 +39,11 @@ operator"" ull(unsigned long long int k) // { dg-warning "integer suffix|shadow ...@@ -39,11 +39,11 @@ operator"" ull(unsigned long long int k) // { dg-warning "integer suffix|shadow
} }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 5 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 5 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 9 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 9 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 13 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 13 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 17 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 17 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 25 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 25 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 29 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 29 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 33 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 33 }
// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 37 } // { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 37 }
...@@ -14,8 +14,8 @@ union B ...@@ -14,8 +14,8 @@ union B
A a; // { dg-error "union member" } A a; // { dg-error "union member" }
}; };
B b; // { dg-error "B::B\\(\\)" } B b; // { dg-error "B::B\\(\\)" "B::B" }
B b2(b); // { dg-error "B::B\\(const B&\\)" } B b2(b); // { dg-error "B::B\\(const B&\\)" "B::B" }
struct C struct C
{ {
...@@ -25,10 +25,10 @@ struct C ...@@ -25,10 +25,10 @@ struct C
}; };
}; };
C c; // { dg-error "C::C\\(\\)" } C c; // { dg-error "C::C\\(\\)" "C::C" }
C c2(c); // { dg-error "C::C\\(const C&\\)" } C c2(c); // { dg-error "C::C\\(const C&\\)" "C::C" }
// { dg-error "B::~B" "" { target *-*-* } 17 } // { dg-error "B::~B" "B::~B" { target *-*-* } 17 }
// { dg-error "B::~B" "" { target *-*-* } 18 } // { dg-error "B::~B" "B::~B" { target *-*-* } 18 }
// { dg-error "C::~C" "" { target *-*-* } 28 } // { dg-error "C::~C" "C::~C" { target *-*-* } 28 }
// { dg-error "C::~C" "" { target *-*-* } 29 } // { dg-error "C::~C" "C::~C" { target *-*-* } 29 }
...@@ -4,6 +4,6 @@ template<typename... Types> struct Tuple { }; ...@@ -4,6 +4,6 @@ template<typename... Types> struct Tuple { };
Tuple<> t0; // Types contains no arguments Tuple<> t0; // Types contains no arguments
Tuple<int> t1; // Types contains one argument: int Tuple<int> t1; // Types contains one argument: int
Tuple<int, float> t2; // Types contains two arguments: int and float Tuple<int, float> t2; // Types contains two arguments: int and float
Tuple<0> error; // { dg-error "mismatch" } Tuple<0> error; // { dg-error "mismatch" "mismatch" }
// { dg-error "expected a type" "" { target *-*-* } 7 } // { dg-error "expected a type" "expected a type" { target *-*-* } 7 }
// { dg-error "in declaration" "" { target *-*-* } 7 } // { dg-error "in declaration" "in declaration" { target *-*-* } 7 }
...@@ -8,12 +8,12 @@ template<template<class> class P> class X { /* ... */ }; ...@@ -8,12 +8,12 @@ template<template<class> class P> class X { /* ... */ };
template<template<class...> class Q> class Y { /* ... */ }; template<template<class...> class Q> class Y { /* ... */ };
X<A> xA; // okay X<A> xA; // okay
X<B> xB; // { dg-error "mismatch" } X<B> xB; // { dg-error "mismatch" "mismatch" }
// { dg-error "expected a template" "" { target *-*-* } 11 } // { dg-error "expected a template" "expected" { target *-*-* } 11 }
// { dg-error "invalid type" "" { target *-*-* } 11 } // { dg-error "invalid type" "invalid" { target *-*-* } 11 }
X<C> xC; // { dg-error "mismatch" } X<C> xC; // { dg-error "mismatch" "mismatch" }
// { dg-error "expected a template" "" { target *-*-* } 14 } // { dg-error "expected a template" "expected" { target *-*-* } 14 }
// { dg-error "invalid type" "" { target *-*-* } 14 } // { dg-error "invalid type" "invalid" { target *-*-* } 14 }
Y<A> yA; Y<A> yA;
Y<B> yB; Y<B> yB;
Y<C> yC; // okay Y<C> yC; // okay
...@@ -8,8 +8,8 @@ class tuple3; ...@@ -8,8 +8,8 @@ class tuple3;
template<typename T1, typename T2, typename... Rest> template<typename T1, typename T2, typename... Rest>
struct two_or_more {}; // { dg-error "provided for" } struct two_or_more {}; // { dg-error "provided for" }
typedef two_or_more<int> bad; // { dg-error "2 or more" } typedef two_or_more<int> bad; // { dg-error "2 or more" "2 or more" }
// { dg-error "invalid type" "" { target *-*-* } 11 } // { dg-error "invalid type" "invalid type" { target *-*-* } 11 }
void f() void f()
{ {
......
...@@ -37,11 +37,11 @@ struct metatuple<First, Second, Metafunctions...> { // { dg-error "struct" } ...@@ -37,11 +37,11 @@ struct metatuple<First, Second, Metafunctions...> { // { dg-error "struct" }
int a0[metatuple<>::value == 0? 1 : -1]; int a0[metatuple<>::value == 0? 1 : -1];
int a1[metatuple<add_pointer>::value == 1? 1 : -1]; int a1[metatuple<add_pointer>::value == 1? 1 : -1];
int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" } int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" }
int a2b[metatuple<add_reference, add_reference>::value == 2? 1 : -1]; int a2b[metatuple<add_reference, add_reference>::value == 2? 1 : -1];
int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" } int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" }
int a4[metatuple<add_reference>::value == 4? 1 : -1]; int a4[metatuple<add_reference>::value == 4? 1 : -1];
int a5[metatuple<add_reference, add_pointer>::value == 5? 1 : -1]; int a5[metatuple<add_reference, add_pointer>::value == 5? 1 : -1];
// { dg-error "incomplete" "" { target *-*-* } 40 } // { dg-error "incomplete" "incomplete" { target *-*-* } 40 }
// { dg-error "incomplete" "" { target *-*-* } 42 } // { dg-error "incomplete" "incomplete" { target *-*-* } 42 }
...@@ -19,8 +19,8 @@ float f; ...@@ -19,8 +19,8 @@ float f;
A<int*, float*>::X<&i, &f> apple1; A<int*, float*>::X<&i, &f> apple1;
B<int, float>::X<&i, &f> banana1; B<int, float>::X<&i, &f> banana1;
A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments" } A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments" "wrong number" }
// { dg-error "invalid type" "" { target *-*-* } 22 } // { dg-error "invalid type" "invalid" { target *-*-* } 22 }
A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" } A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" }
// { dg-error "invalid type" "" { target *-*-* } 24 } // { dg-error "invalid type" "invalid" { target *-*-* } 24 }
A<int, float> apple4; A<int, float> apple4;
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
template<int> struct A template<int> struct A
{ {
struct {} : 2; // { dg-error "expected ';' after struct" } struct {} : 2; // { dg-error "expected ';' after struct" "expected" }
}; };
// { dg-error "ISO C.. forbids declaration" "" { target *-*-* } 6 } // { dg-error "ISO C.. forbids declaration" "declaration" { target *-*-* } 6 }
// { dg-error "ISO C.. prohibits anonymous" "" { target *-*-* } 6 } // { dg-error "ISO C.. prohibits anonymous" "anonymous" { target *-*-* } 6 }
// PR c++/52671 // PR c++/52671
// { dg-do compile } // { dg-do compile }
__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" } __attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" "ignored" }
// { dg-message "must follow the" "" { target *-*-* } 3 } // { dg-message "must follow the" "must follow" { target *-*-* } 3 }
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
// keywords. // keywords.
int asm; // { dg-error "before .asm." } int asm; // { dg-error "before .asm." }
int typeof; // { dg-error "expected" } int typeof; // { dg-error "expected" "expected" }
// { dg-error "multiple types" "" { target *-*-* } 8 } // { dg-error "multiple types" "multiple" { target *-*-* } 8 }
// { dg-error "declaration" "" { target *-*-* } 8 } // { dg-error "declaration" "declaration" { target *-*-* } 8 }
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// { dg-do compile } // { dg-do compile }
// { dg-options "" } // { dg-options "" }
S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" } S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" "decl" }
// { dg-error "only constructors" "" { target *-*-* } 5 } // { dg-error "only constructors" "constructor" { target *-*-* } 5 }
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
// { dg-do compile } // { dg-do compile }
void void
foo (_Decimal32) // { dg-error "declared void" } foo (_Decimal32) // { dg-error "declared void" "declared" }
{ {
} }
// { dg-error "was not declared" "" { target *-*-* } 5 } // { dg-error "was not declared" "not" { target *-*-* } 5 }
void void
bar (_Bool) // { dg-error "declared void" } bar (_Bool) // { dg-error "declared void" "declared" }
{ {
} }
// { dg-error "was not declared" "" { target *-*-* } 10 } // { dg-error "was not declared" "not" { target *-*-* } 10 }
void void
baz (_Fract) // { dg-error "declared void" } baz (_Fract) // { dg-error "declared void" "declared" }
{ {
} }
// { dg-error "was not declared" "" { target *-*-* } 15 } // { dg-error "was not declared" "not" { target *-*-* } 15 }
...@@ -15,5 +15,5 @@ template <typename T> void foo() ...@@ -15,5 +15,5 @@ template <typename T> void foo()
} }
// Here, columns nums are not very accurate either. Still acceptable though // Here, columns nums are not very accurate either. Still acceptable though
// { dg-error "30:invalid type in declaration before ';' token" "" { target *-*-* } 14 } // { dg-error "30:invalid type in declaration before ';' token" "invalid" { target *-*-* } 14 }
// { dg-error "30:two or more data types in declaration of 'e4'" "" { target *-*-* } 14 } // { dg-error "30:two or more data types in declaration of 'e4'" "2 or more" { target *-*-* } 14 }
...@@ -8,8 +8,8 @@ int func(double); ...@@ -8,8 +8,8 @@ int func(double);
template <int> template <int>
struct Foo {}; struct Foo {};
Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } 11 } Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "func double" { target *-*-* } 11 }
// { dg-error "10:'g' cannot appear in a constant-expression" "" { target *-*-* } 11 } // { dg-error "10:'g' cannot appear in a constant-expression" "g" { target *-*-* } 11 }
// { dg-error "11:a function call cannot appear in a constant-expression" "" { target *-*-* } 11 } // { dg-error "11:a function call cannot appear in a constant-expression" "call" { target *-*-* } 11 }
// { dg-error "12:template argument 1 is invalid" "" { target *-*-* } 11 } // { dg-error "12:template argument 1 is invalid" "invalid template argument" { target *-*-* } 11 }
// { dg-error "15:invalid type in declaration before ';' token" "" { target *-*-* } 11 } // { dg-error "15:invalid type in declaration before ';' token" "invalid type" { target *-*-* } 11 }
...@@ -5,5 +5,5 @@ static void InstantiateConstraint(const float&, unsigned, ...@@ -5,5 +5,5 @@ static void InstantiateConstraint(const float&, unsigned,
void(*AddFunction)(const TYPE&,bool&, void(*AddFunction)(const TYPE&,bool&,
char*, char*, char*, char*,
unsigned*)); unsigned*));
// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "" { target *-*-* } { 5 } } // { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "forbids" { target *-*-* } { 5 } }
// { dg-error "60: 'TYPE' does not name a type" "" { target *-*-* } { 5 } } // { dg-error "60: 'TYPE' does not name a type" "does not" { target *-*-* } { 5 } }
...@@ -11,22 +11,22 @@ template <class T> ...@@ -11,22 +11,22 @@ template <class T>
void f(T t) void f(T t)
{ {
typedef A<T>::foo type; // { dg-error "typename" } typedef A<T>::foo type; // { dg-error "typename" }
A<T>::bar b; // { dg-error "typename" } A<T>::bar b; // { dg-error "typename" "typename" }
} // { dg-error "expected ';'" "" { target *-*-* } 14 } } // { dg-error "expected ';'" "expected" { target *-*-* } 14 }
// PR c++/36353 // PR c++/36353
template <class T> struct B template <class T> struct B
{ {
void f() void f()
{ {
A<T>::baz z; // { dg-error "typename" } A<T>::baz z; // { dg-error "typename" "typename" }
} // { dg-error "expected ';'" "" { target *-*-* } 22 } } // { dg-error "expected ';'" "expected" { target *-*-* } 22 }
}; };
// PR c++/40738 // PR c++/40738
template <class T> template <class T>
void g(const A<T>::type &t); // { dg-error "typename" } void g(const A<T>::type &t); // { dg-error "typename" "typename" }
// { dg-error "no type" "" { target *-*-* } 28 } // { dg-error "no type" "no type" { target *-*-* } 28 }
// PR c++/18451 // PR c++/18451
template <class T> A<T>::B A<T>::b; // { dg-error "typename" } template <class T> A<T>::B A<T>::b; // { dg-error "typename" }
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
struct A { friend typename struct B; }; struct A { friend typename struct B; };
// { dg-error "28:expected nested-name-specifier before 'struct'" "" { target *-*-* } 4 } // { dg-error "28:expected nested-name-specifier before 'struct'" "expected" { target *-*-* } 4 }
// { dg-error "35:multiple types in one declaration" "" { target *-*-* } 4 } // { dg-error "35:multiple types in one declaration" "multiple" { target *-*-* } 4 }
// { dg-error "12:friend declaration does not name a class or function" "" { target *-*-* } 4 } // { dg-error "12:friend declaration does not name a class or function" "friend decl" { target *-*-* } 4 }
...@@ -5,5 +5,5 @@ enum { FOO = 1, BAR = 2 }; ...@@ -5,5 +5,5 @@ enum { FOO = 1, BAR = 2 };
int a[] = { FOO: 1, BAR: 2 }; int a[] = { FOO: 1, BAR: 2 };
// the following 2 column locations are still not accurate enough // the following 2 column locations are still not accurate enough
// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } // { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "FOO" { target *-*-* } 5 }
// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } // { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "BAR" { target *-*-* } 5 }
...@@ -6,8 +6,8 @@ main (void) ...@@ -6,8 +6,8 @@ main (void)
{ {
__complex__ float z; __complex__ float z;
z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" } z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" "primary-expression" }
// { dg-error "expected .;. before .__complex__." "" { target *-*-* } 9 } // { dg-error "expected .;. before .__complex__." "semicolon" { target *-*-* } 9 }
z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" } z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" "primaty-expression" }
// { dg-error "expected .;. before '__complex__'" "" { target *-*-* } 11 } // { dg-error "expected .;. before '__complex__'" "semicolon" { target *-*-* } 11 }
// { dg-error "at end of input" "" { target *-*-* } 11 } // { dg-error "at end of input" "end" { target *-*-* } 11 }
...@@ -6,8 +6,8 @@ main (void) ...@@ -6,8 +6,8 @@ main (void)
{ {
_Complex float z; _Complex float z;
z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" } z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
// { dg-error "expected .;. before ._Complex." "" { target *-*-* } 9 } // { dg-error "expected .;. before ._Complex." "semicolon" { target *-*-* } 9 }
z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" } z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
// { dg-error "expected .;. before '_Complex'" "" { target *-*-* } 11 } // { dg-error "expected .;. before '_Complex'" "semicolon" { target *-*-* } 11 }
// { dg-error "at end of input" "" { target *-*-* } 11 } // { dg-error "at end of input" "end" { target *-*-* } 11 }
...@@ -9,6 +9,6 @@ void f(void) ...@@ -9,6 +9,6 @@ void f(void)
void g(void) void g(void)
{ {
template f<int>(); /* { dg-error "expected primary-expression" } */ template f<int>(); /* { dg-error "expected primary-expression" "primary-expression" } */
/* { dg-error "expected ';'" "" { target *-*-* } 12 } */ /* { dg-error "expected ';'" "semicolon" { target *-*-* } 12 } */
} }
...@@ -10,7 +10,7 @@ template <int dim> struct Y : X<dim> { ...@@ -10,7 +10,7 @@ template <int dim> struct Y : X<dim> {
// note: I is nested type in X, not Y! // note: I is nested type in X, not Y!
template <int dim> template <int dim>
Y<dim>::I::I () {} // { dg-error "dependent typedef" } Y<dim>::I::I () {} // { dg-error "dependent typedef" "typedef" }
// { dg-error "no type|dependent type" "" { target *-*-* } 13 } // { dg-error "no type|dependent type" "no type" { target *-*-* } 13 }
template struct Y<1>; template struct Y<1>;
...@@ -20,8 +20,8 @@ void A::f() ...@@ -20,8 +20,8 @@ void A::f()
void f() void f()
{ {
A::A a; // { dg-error "constructor" } A::A a; // { dg-error "constructor" "constructor" }
} // { dg-error "" "" { target *-*-* } 23 } error cascade } // { dg-error "" "error cascade" { target *-*-* } 23 } error cascade
} }
namespace N2 { namespace N2 {
......
template <typename T> template <typename T>
void f(int, T (*)() = 0); // { dg-message "note" } void f(int, T (*)() = 0); // { dg-message "note" "note" }
void g() { void g() {
typedef int A[2]; typedef int A[2];
f<A>(0); // { dg-error "" } f<A>(0); // { dg-error "" }
// { dg-error "returning an array" "candidate explanation" { target *-*-* } 2 } // { dg-error "returning an array" "returning an array" { target *-*-* } 2 }
typedef void F(); typedef void F();
f<F>(0); // { dg-error "" } f<F>(0); // { dg-error "" }
// { dg-error "returning a function" "candidate explanation" { target *-*-* } 2 } // { dg-error "returning a function" "returning a function" { target *-*-* } 2 }
} }
...@@ -16,8 +16,8 @@ struct A ...@@ -16,8 +16,8 @@ struct A
template <class T> struct B: A<T> template <class T> struct B: A<T>
{ {
void f() { h(T()); } // { dg-error "argument-dependent" } void f() { h(T()); } // { dg-error "argument-dependent" "arg-dep" }
static void g() { h(T()); } // { dg-error "argument-dependent" } static void g() { h(T()); } // { dg-error "argument-dependent" "arg-dep" }
}; };
int main() int main()
...@@ -27,7 +27,7 @@ int main() ...@@ -27,7 +27,7 @@ int main()
b.g(); b.g();
} }
// { dg-message "dependent base .A.int" "" { target *-*-* } 19 } // { dg-message "dependent base .A.int" "base" { target *-*-* } 19 }
// { dg-message "this->h" "" { target *-*-* } 19 } // { dg-message "this->h" "this->h" { target *-*-* } 19 }
// { dg-message "dependent base .A.int" "" { target *-*-* } 20 } // { dg-message "dependent base .A.int" "base" { target *-*-* } 20 }
// { dg-message "B::h" "" { target *-*-* } 20 } // { dg-message "B::h" "B::h" { target *-*-* } 20 }
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
template<unsigned int nFactor> template<unsigned int nFactor>
struct Factorial struct Factorial
{ {
enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" } enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" "exceeds" }
// { dg-message "recursively required" "" { target *-*-* } 6 } // { dg-message "recursively required" "recurse" { target *-*-* } 6 }
// { dg-error "incomplete type" "" { target *-*-* } 6 } // { dg-error "incomplete type" "incomplete" { target *-*-* } 6 }
} // { dg-error "expected ';' after" } } // { dg-error "expected ';' after" }
template<> template<>
......
...@@ -10,8 +10,8 @@ void example () ...@@ -10,8 +10,8 @@ void example ()
X x; X x;
Y y; Y y;
x = 10; // { dg-warning "invalid conversion from .int. to .X." } x = 10; // { dg-warning "invalid conversion from .int. to .X." "invalid" }
// { dg-warning "unspecified" "" { target *-*-* } 13 } // { dg-warning "unspecified" "unspecified" { target *-*-* } 13 }
x = 1; // { dg-warning "invalid conversion from .int. to .X." } x = 1; // { dg-warning "invalid conversion from .int. to .X." }
x = C; // { dg-error "cannot convert .Y. to .X. in assignment" } x = C; // { dg-error "cannot convert .Y. to .X. in assignment" }
x = D; // { dg-error "cannot convert .Y. to .X. in assignment" } x = D; // { dg-error "cannot convert .Y. to .X. in assignment" }
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// { dg-do compile } // { dg-do compile }
// { dg-options "-pedantic-errors" } // { dg-options "-pedantic-errors" }
// { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } // { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } }
int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." } */ int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." "int" } */
/* { dg-error "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-error "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// { dg-do compile } // { dg-do compile }
// { dg-options "" } // { dg-options "" }
// { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } } // { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } }
int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." } */ int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." "int" } */
/* { dg-warning "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-warning "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
...@@ -13,5 +13,5 @@ public: ...@@ -13,5 +13,5 @@ public:
template<class T> template<class T>
void f() void f()
{ {
Vector<T>::iterator i = 0; // { dg-error "typename" } missing typename Vector<T>::iterator i = 0; // { dg-error "typename" "typename" } missing typename
} // { dg-error "expected" "" { target *-*-* } 16 } } // { dg-error "expected" "expected" { target *-*-* } 16 }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// { dg-options "-fshow-column" } // { dg-options "-fshow-column" }
struct A { // { dg-error "" } forward declaration struct A { // { dg-error "" } forward declaration
friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" } friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" "invalid" }
int x; int x;
}; // { dg-error "class definition may not be declared a friend" "" { target *-*-* } { 5 } } }; // { dg-error "class definition may not be declared a friend" "may not" { target *-*-* } { 5 } }
int y; int y;
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment