Commit 48ca24b2 by Janis Johnson Committed by Janis Johnson

re PR testsuite/25241 ([C++] DejaGNU does not distinguish between errors and warnings)

	PR testsuite/25241
	* lib/g++.exp (g++_init): Enable overrides of dg-error, dg-warning
	for C++ tests.
	* g++.dg/conversion/ambig1.C: Clean up dg-error/dg-warning; use
	dg-message for notes.
	* g++.dg/conversion/simd1.C: Ditto.
	* g++.dg/conversion/simd3.C: Ditto.
	* g++.dg/cpp0x/rv2n.C: Ditto.
	* g++.dg/cpp0x/rv3n.C: Ditto.
	* g++.dg/cpp0x/rv4n.C: Ditto.
	* g++.dg/cpp0x/rv5n.C: Ditto.
	* g++.dg/cpp0x/rv6n.C: Ditto.
	* g++.dg/cpp0x/rv7n.C: Ditto.
	* g++.dg/cpp0x/variadic36.C: Ditto.
	* g++.dg/cpp0x/variadic59.C: Ditto.
	* g++.dg/cpp0x/variadic71.C: Ditto.
	* g++.dg/cpp0x/variadic-ex13.C: Ditto.
	* g++.dg/expr/cond9.C: Ditto.
	* g++.dg/expr/pmf-1.C: Ditto.
	* g++.dg/ext/case-range2.C: Ditto.
	* g++.dg/ext/case-range3.C: Ditto.
	* g++.dg/ext/is_class_error2.C: Ditto.
	* g++.dg/ext/label5.C: Ditto.
	* g++.dg/ext/pr27019.C: Ditto.
	* g++.dg/gomp/pr26690-1.C: Ditto.
	* g++.dg/gomp/pr26690-2.C: Ditto.
	* g++.dg/gomp/pr34694.C: Ditto.
	* g++.dg/gomp/tpl-parallel-2.C: Ditto.
	* g++.dg/inherit/base3.C: Ditto.
	* g++.dg/inherit/using6.C: Ditto.
	* g++.dg/init/brace6.C: Ditto.
	* g++.dg/init/ctor4.C: Ditto.
	* g++.dg/lookup/conv-1.C: Ditto.
	* g++.dg/lookup/new1.C: Ditto.
	* g++.dg/lookup/scoped6.C: Ditto.
	* g++.dg/lookup/using7.C: Ditto.
	* g++.dg/lookup/using9.C: Ditto.
	* g++.dg/other/abstract1.C: Ditto.
	* g++.dg/other/abstract2.C: Ditto.
	* g++.dg/other/anon5.C: Ditto.
	* g++.dg/other/crash-4.C: Ditto.
	* g++.dg/other/error10.C: Ditto.
	* g++.dg/other/error13.C: Ditto.
	* g++.dg/other/error20.C: Ditto.
	* g++.dg/other/error5.C: Ditto.
	* g++.dg/other/field1.C: Ditto.
	* g++.dg/other/offsetof5.C: Ditto.
	* g++.dg/other/semicolon.C: Ditto.
	* g++.dg/overload/ambig1.C: Ditto.
	* g++.dg/overload/arg3.C: Ditto.
	* g++.dg/overload/builtin1.C: Ditto.
	* g++.dg/overload/copy1.C: Ditto.
	* g++.dg/overload/new1.C: Ditto.
	* g++.dg/overload/template4.C: Ditto.
	* g++.dg/overload/using2.C: Ditto.
	* g++.dg/parse/bitfield2.C: Ditto.
	* g++.dg/parse/constant4.C: Ditto.
	* g++.dg/parse/crash20.C: Ditto.
	* g++.dg/parse/crash36.C: Ditto.
	* g++.dg/parse/crash5.C: Ditto.
	* g++.dg/parse/error11.C: Ditto.
	* g++.dg/parse/error12.C: Ditto.
	* g++.dg/parse/error19.C: Ditto.
	* g++.dg/parse/error28.C: Ditto.
	* g++.dg/parse/friend5.C: Ditto.
	* g++.dg/parse/invalid-op1.C: Ditto.
	* g++.dg/parse/missing-template1.C: Ditto.
	* g++.dg/parse/non-dependent2.C: Ditto.
	* g++.dg/parse/ret-type2.C: Ditto.
	* g++.dg/parse/specialization1.C: Ditto.
	* g++.dg/parse/template18.C: Ditto.
	* g++.dg/parse/template3.C: Ditto.
	* g++.dg/parse/template9.C: Ditto.
	* g++.dg/tc1/dr108.C: Ditto.
	* g++.dg/tc1/dr152.C: Ditto.
	* g++.dg/tc1/dr166.C: Ditto.
	* g++.dg/template/access11.C: Ditto.
	* g++.dg/template/access2.C: Ditto.
	* g++.dg/template/access3.C: Ditto.
	* g++.dg/template/access7.C: Ditto.
	* g++.dg/template/copy1.C: Ditto.
	* g++.dg/template/crash13.C: Ditto.
	* g++.dg/template/crash37.C: Ditto.
	* g++.dg/template/crash40.C: Ditto.
	* g++.dg/template/crash58.C: Ditto.
	* g++.dg/template/ctor5.C: Ditto.
	* g++.dg/template/dependent-expr5.C: Ditto.
	* g++.dg/template/eh2.C: Ditto.
	* g++.dg/template/error2.C: Ditto.
	* g++.dg/template/error33.C: Ditto.
	* g++.dg/template/error4.C: Ditto.
	* g++.dg/template/friend31.C: Ditto.
	* g++.dg/template/friend32.C: Ditto.
	* g++.dg/template/instantiate1.C: Ditto.
	* g++.dg/template/instantiate3.C: Ditto.
	* g++.dg/template/instantiate5.C: Ditto.
	* g++.dg/template/instantiate7.C: Ditto.
	* g++.dg/template/local6.C: Ditto.
	* g++.dg/template/lookup2.C: Ditto.
	* g++.dg/template/member5.C: Ditto.
	* g++.dg/template/memfriend15.C: Ditto.
	* g++.dg/template/memfriend16.C: Ditto.
	* g++.dg/template/memfriend17.C: Ditto.
	* g++.dg/template/memfriend7.C: Ditto.
	* g++.dg/template/meminit1.C: Ditto.
	* g++.dg/template/nested3.C: Ditto.
	* g++.dg/template/new3.C: Ditto.
	* g++.dg/template/nontype12.C: Ditto.
	* g++.dg/template/nontype13.C: Ditto.
	* g++.dg/template/nontype6.C: Ditto.
	* g++.dg/template/non-type-template-argument-1.C: Ditto.
	* g++.dg/template/overload9.C: Ditto.
	* g++.dg/template/ptrmem15.C: Ditto.
	* g++.dg/template/ptrmem17.C: Ditto.
	* g++.dg/template/ptrmem4.C: Ditto.
	* g++.dg/template/ptrmem6.C: Ditto.
	* g++.dg/template/ptrmem8.C: Ditto.
	* g++.dg/template/qualified-id1.C: Ditto.
	* g++.dg/template/qualttp20.C: Ditto.
	* g++.dg/template/qualttp3.C: Ditto.
	* g++.dg/template/qualttp4.C: Ditto.
	* g++.dg/template/qualttp5.C: Ditto.
	* g++.dg/template/qualttp6.C: Ditto.
	* g++.dg/template/qualttp7.C: Ditto.
	* g++.dg/template/qualttp8.C: Ditto.
	* g++.dg/template/recurse.C: Ditto.
	* g++.dg/template/sfinae10.C: Ditto.
	* g++.dg/template/sfinae3.C: Ditto.
	* g++.dg/template/spec22.C: Ditto.
	* g++.dg/template/spec23.C: Ditto.
	* g++.dg/template/static9.C: Ditto.
	* g++.dg/template/template-id-2.C: Ditto.
	* g++.dg/template/typename2.C: Ditto.
	* g++.dg/template/typename4.C: Ditto.
	* g++.dg/template/using14.C: Ditto.
	* g++.dg/template/using2.C: Ditto.
	* g++.dg/template/warn1.C: Ditto.
	* g++.dg/warn/incomplete1.C: Ditto.
	* g++.dg/warn/noeffect2.C: Ditto.
	* g++.dg/warn/noeffect4.C: Ditto.
	* g++.dg/warn/pr8570.C: Ditto.
	* g++.dg/warn/Wparentheses-13.C: Ditto.
	* g++.dg/warn/Wparentheses-15.C: Ditto.
	* g++.dg/warn/Wparentheses-16.C: Ditto.
	* g++.dg/warn/Wparentheses-17.C: Ditto.
	* g++.dg/warn/Wparentheses-18.C: Ditto.
	* g++.dg/warn/Wparentheses-19.C: Ditto.
	* g++.dg/warn/Wparentheses-20.C: Ditto.
	* g++.dg/warn/Wparentheses-23.C: Ditto.
	* g++.dg/warn/Wstrict-aliasing-3.C: Ditto.
	* g++.old-deja/g++.benjamin/15799.C: Ditto.
	* g++.old-deja/g++.benjamin/15800-1.C: Ditto.
	* g++.old-deja/g++.benjamin/16077.C: Ditto.
	* g++.old-deja/g++.bob/inherit2.C: Ditto.
	* g++.old-deja/g++.brendan/ambiguity1.C: Ditto.
	* g++.old-deja/g++.brendan/crash29.C: Ditto.
	* g++.old-deja/g++.brendan/crash48.C: Ditto.
	* g++.old-deja/g++.brendan/crash56.C: Ditto.
	* g++.old-deja/g++.brendan/cvt3.C: Ditto.
	* g++.old-deja/g++.brendan/overload1.C: Ditto.
	* g++.old-deja/g++.brendan/overload4.C: Ditto.
	* g++.old-deja/g++.brendan/overload9.C: Ditto.
	* g++.old-deja/g++.bugs/900127_01.C: Ditto.
	* g++.old-deja/g++.bugs/900205_04.C: Ditto.
	* g++.old-deja/g++.bugs/900330_02.C: Ditto.
	* g++.old-deja/g++.bugs/900404_03.C: Ditto.
	* g++.old-deja/g++.bugs/900514_03.C: Ditto.
	* g++.old-deja/g++.eh/ctor1.C: Ditto.
	* g++.old-deja/g++.eh/spec6.C: Ditto.
	* g++.old-deja/g++.ext/overload1.C: Ditto.
	* g++.old-deja/g++.jason/conversion11.C: Ditto.
	* g++.old-deja/g++.jason/crash3.C: Ditto.
	* g++.old-deja/g++.jason/lineno3.C: Ditto.
	* g++.old-deja/g++.jason/lineno4.C: Ditto.
	* g++.old-deja/g++.jason/opeq3.C: Ditto.
	* g++.old-deja/g++.jason/overload16.C: Ditto.
	* g++.old-deja/g++.jason/overload28.C: Ditto.
	* g++.old-deja/g++.jason/pmf5.C: Ditto.
	* g++.old-deja/g++.jason/scoping10.C: Ditto.
	* g++.old-deja/g++.jason/template30.C: Ditto.
	* g++.old-deja/g++.jason/temporary2.C: Ditto.
	* g++.old-deja/g++.jason/tredecl4.C: Ditto.
	* g++.old-deja/g++.law/arg11.C: Ditto.
	* g++.old-deja/g++.law/arg1.C: Ditto.
	* g++.old-deja/g++.law/arm9.C: Ditto.
	* g++.old-deja/g++.law/ctors11.C: Ditto.
	* g++.old-deja/g++.law/ctors17.C: Ditto.
	* g++.old-deja/g++.law/ctors5.C: Ditto.
	* g++.old-deja/g++.law/ctors9.C: Ditto.
	* g++.old-deja/g++.law/enum4.C: Ditto.
	* g++.old-deja/g++.law/missed-error2.C: Ditto.
	* g++.old-deja/g++.law/operators9.C: Ditto.
	* g++.old-deja/g++.mike/net22.C: Ditto.
	* g++.old-deja/g++.mike/net2.C: Ditto.
	* g++.old-deja/g++.mike/p11110.C: Ditto.
	* g++.old-deja/g++.mike/p1989.C: Ditto.
	* g++.old-deja/g++.mike/p2431.C: Ditto.
	* g++.old-deja/g++.mike/p438.C: Ditto.
	* g++.old-deja/g++.mike/p807a.C: Ditto.
	* g++.old-deja/g++.mike/p9068.C: Ditto.
	* g++.old-deja/g++.niklas/t120.C: Ditto.
	* g++.old-deja/g++.niklas/t121.C: Ditto.
	* g++.old-deja/g++.niklas/t128.C: Ditto.
	* g++.old-deja/g++.ns/overload2.C: Ditto.
	* g++.old-deja/g++.ns/template13.C: Ditto.
	* g++.old-deja/g++.ns/using12.C: Ditto.
	* g++.old-deja/g++.oliva/delete1.C: Ditto.
	* g++.old-deja/g++.oliva/overload1.C: Ditto.
	* g++.old-deja/g++.other/crash24.C: Ditto.
	* g++.old-deja/g++.other/crash25.C: Ditto.
	* g++.old-deja/g++.other/decl3.C: Ditto.
	* g++.old-deja/g++.other/expr1.C: Ditto.
	* g++.old-deja/g++.other/overcnv2.C: Ditto.
	* g++.old-deja/g++.other/overload11.C: Ditto.
	* g++.old-deja/g++.other/pmf3.C: Ditto.
	* g++.old-deja/g++.other/ptrmem7.C: Ditto.
	* g++.old-deja/g++.other/vaarg3.C: Ditto.
	* g++.old-deja/g++.other/volatile1.C: Ditto.
	* g++.old-deja/g++.pt/assign1.C: Ditto.
	* g++.old-deja/g++.pt/auto_ptr.C: Ditto.
	* g++.old-deja/g++.pt/const2.C: Ditto.
	* g++.old-deja/g++.pt/crash10.C: Ditto.
	* g++.old-deja/g++.pt/crash20.C: Ditto.
	* g++.old-deja/g++.pt/crash36.C: Ditto.
	* g++.old-deja/g++.pt/crash38.C: Ditto.
	* g++.old-deja/g++.pt/derived3.C: Ditto.
	* g++.old-deja/g++.pt/error2.C: Ditto.
	* g++.old-deja/g++.pt/explicit34.C: Ditto.
	* g++.old-deja/g++.pt/explicit70.C: Ditto.
	* g++.old-deja/g++.pt/friend23.C: Ditto.
	* g++.old-deja/g++.pt/ptrmem10.C: Ditto.
	* g++.old-deja/g++.pt/redecl1.C: Ditto.
	* g++.old-deja/g++.pt/spec35.C: Ditto.
	* g++.old-deja/g++.pt/t05.C: Ditto.
	* g++.old-deja/g++.pt/typename3.C: Ditto.
	* g++.old-deja/g++.pt/typename6.C: Ditto.
	* g++.old-deja/g++.pt/unify8.C: Ditto.
	* g++.old-deja/g++.pt/vaarg3.C: Ditto.
	* g++.old-deja/g++.robertl/eb109.C: Ditto.
	* g++.old-deja/g++.robertl/eb131.C: Ditto.
	* g++.old-deja/g++.robertl/eb22.C: Ditto.
	* g++.old-deja/g++.robertl/eb44.C: Ditto.
	* g++.old-deja/g++.robertl/eb4.C: Ditto.
	* g++.old-deja/g++.robertl/eb69.C: Ditto.
	* g++.dg/parse/constructor1.C: Remove "error" from dg-error, preserving
	column number.
	* g++.dg/parse/error10.C: Ditto.
	* g++.dg/parse/error13.C: Ditto.
	* g++.dg/parse/error14.C: Ditto.
	* g++.dg/parse/error15.C: Ditto.
	* g++.dg/parse/error16.C: Ditto.
	* g++.dg/parse/error17.C: Ditto.
	* g++.dg/parse/error18.C: Ditto.
	* g++.dg/parse/error1.C: Ditto.
	* g++.dg/parse/error20.C: Ditto.
	* g++.dg/parse/error21.C: Ditto.
	* g++.dg/parse/error22.C: Ditto.
	* g++.dg/parse/error23.C: Ditto.
	* g++.dg/parse/error24.C: Ditto.
	* g++.dg/parse/error25.C: Ditto.
	* g++.dg/parse/error26.C: Ditto.
	* g++.dg/parse/error27.C: Ditto.
	* g++.dg/parse/error29.C: Ditto.
	* g++.dg/parse/error2.C: Ditto.
	* g++.dg/parse/error30.C: Ditto.
	* g++.dg/parse/error31.C: Ditto.
	* g++.dg/parse/error3.C: Ditto.
	* g++.dg/parse/error4.C: Ditto.
	* g++.dg/parse/error5.C: Ditto.
	* g++.dg/parse/error6.C: Ditto.
	* g++.dg/parse/error7.C: Ditto.
	* g++.dg/parse/error8.C: Ditto.
	* g++.dg/parse/error9.C: Ditto.
	* g++.dg/parse/error-column.C: Ditto.
	* g++.dg/template/crash80.C: Ditto.
	* g++.dg/template/friend44.C: Ditto.
	* g++.dg/warn/pr26785.C: Ditto.
	* g++.old-deja/g++.brendan/crash16.C: Ditto.

From-SVN: r140476
parent faae4ae7
// PR c++/19787
struct H {
operator char(); // { dg-error "" }
operator short(); // { dg-error "" }
operator char(); // { dg-message "note" }
operator short(); // { dg-message "note" }
};
int const& ref = H(); // { dg-error "" }
int const& ref = H(); // { dg-error "ambiguous" }
......@@ -5,9 +5,9 @@
#define vector __attribute__((vector_size(16)))
vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-error "vld" } */
vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-message "vld" } */
/* { dg-warning "vector returned by ref" "" { target { powerpc*-*-linux* && ilp32 } } 8 } */
vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-error "vld" } */
vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-message "vld" } */
extern int i;
extern vector signed short vss;
......
......@@ -10,6 +10,6 @@ unsigned int __attribute__((vector_size(16))) e;
void foo()
{
b + d; /* { dg-error "invalid operands to binary" } */
d += e; /* { dg-error "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert 'unsigned int __vector__' to 'int __vector__' in assignment" } */
d += e; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert 'unsigned int __vector__' to 'int __vector__' in assignment" } */
d2 += d;
}
......@@ -30,8 +30,8 @@ const volatile A cv_source();
// 2 at a time
one sink_2_12( A&); // { dg-error "" }
two sink_2_12(const A&); // { dg-error "" }
one sink_2_12( A&); // { dg-message "candidates" }
two sink_2_12(const A&); // { dg-message "note" }
int test2_12()
{
......@@ -46,8 +46,8 @@ int test2_12()
return 0;
}
one sink_2_13( A&); // { dg-error "" }
three sink_2_13(volatile A&); // { dg-error "" }
one sink_2_13( A&); // { dg-message "candidates" }
three sink_2_13(volatile A&); // { dg-message "note" }
int test2_13()
{
......@@ -64,8 +64,8 @@ int test2_13()
return 0;
}
one sink_2_14( A&); // { dg-error "" }
four sink_2_14(const volatile A&); // { dg-error "" }
one sink_2_14( A&); // { dg-message "candidates" }
four sink_2_14(const volatile A&); // { dg-message "note" }
int test2_14()
{
......@@ -80,8 +80,8 @@ int test2_14()
return 0;
}
one sink_2_15( A&); // { dg-error "" }
five sink_2_15( A&&); // { dg-error "" }
one sink_2_15( A&); // { dg-message "candidates" }
five sink_2_15( A&&); // { dg-message "note" }
int test2_15()
{
......@@ -98,8 +98,8 @@ int test2_15()
return 0;
}
one sink_2_16( A&); // { dg-error "" }
six sink_2_16(const A&&); // { dg-error "" }
one sink_2_16( A&); // { dg-message "candidates" }
six sink_2_16(const A&&); // { dg-message "note" }
int test2_16()
{
......@@ -114,8 +114,8 @@ int test2_16()
return 0;
}
one sink_2_17( A&); // { dg-error "" }
seven sink_2_17(volatile A&&); // { dg-error "" }
one sink_2_17( A&); // { dg-message "candidates" }
seven sink_2_17(volatile A&&); // { dg-message "note" }
int test2_17()
{
......@@ -130,8 +130,8 @@ int test2_17()
return 0;
}
two sink_2_23(const A&); // { dg-error "" }
three sink_2_23(volatile A&); // { dg-error "" }
two sink_2_23(const A&); // { dg-message "candidates" }
three sink_2_23(volatile A&); // { dg-message "note" }
int test2_23()
{
......@@ -146,8 +146,8 @@ int test2_23()
return 0;
}
two sink_2_24(const A&); // { dg-error "" }
four sink_2_24(const volatile A&); // { dg-error "" }
two sink_2_24(const A&); // { dg-message "candidates" }
four sink_2_24(const volatile A&); // { dg-message "note" }
int test2_24()
{
......@@ -160,8 +160,8 @@ int test2_24()
return 0;
}
three sink_2_34(volatile A&); // { dg-error "" }
four sink_2_34(const volatile A&); // { dg-error "" }
three sink_2_34(volatile A&); // { dg-message "candidate" }
four sink_2_34(const volatile A&); // { dg-message "note" }
int test2_34()
{
......@@ -176,8 +176,8 @@ int test2_34()
return 0;
}
two sink_2_25(const A&); // { dg-error "" }
five sink_2_25( A&&); // { dg-error "" }
two sink_2_25(const A&); // { dg-message "candidate" }
five sink_2_25( A&&); // { dg-message "note" }
int test2_25()
{
......@@ -192,8 +192,8 @@ int test2_25()
return 0;
}
two sink_2_26(const A&); // { dg-error "" }
six sink_2_26(const A&&); // { dg-error "" }
two sink_2_26(const A&); // { dg-message "candidate" }
six sink_2_26(const A&&); // { dg-message "note" }
int test2_26()
{
......@@ -208,8 +208,8 @@ int test2_26()
return 0;
}
two sink_2_27(const A&); // { dg-error "" }
seven sink_2_27(volatile A&&); // { dg-error "" }
two sink_2_27(const A&); // { dg-message "candidate" }
seven sink_2_27(volatile A&&); // { dg-message "note" }
int test2_27()
{
......@@ -222,8 +222,8 @@ int test2_27()
return 0;
}
three sink_2_35(volatile A&); // { dg-error "" }
five sink_2_35( A&&); // { dg-error "" }
three sink_2_35(volatile A&); // { dg-message "candidate" }
five sink_2_35( A&&); // { dg-message "note" }
int test2_35()
{
......@@ -239,8 +239,8 @@ int test2_35()
return 0;
}
three sink_2_36(volatile A&); // { dg-error "" }
six sink_2_36(const A&&); // { dg-error "" }
three sink_2_36(volatile A&); // { dg-message "candidate" }
six sink_2_36(const A&&); // { dg-message "note" }
int test2_36()
{
......@@ -254,8 +254,8 @@ int test2_36()
return 0;
}
three sink_2_37(volatile A&); // { dg-error "" }
seven sink_2_37(volatile A&&); // { dg-error "" }
three sink_2_37(volatile A&); // { dg-message "candidate" }
seven sink_2_37(volatile A&&); // { dg-message "note" }
int test2_37()
{
......@@ -270,8 +270,8 @@ int test2_37()
return 0;
}
four sink_2_45(const volatile A&); // { dg-error "" }
five sink_2_45( A&&); // { dg-error "" }
four sink_2_45(const volatile A&); // { dg-message "candidate" }
five sink_2_45( A&&); // { dg-message "note" }
int test2_45()
{
......@@ -285,8 +285,8 @@ int test2_45()
return 0;
}
four sink_2_46(const volatile A&); // { dg-error "" }
six sink_2_46(const A&&); // { dg-error "" }
four sink_2_46(const volatile A&); // { dg-message "candidate" }
six sink_2_46(const A&&); // { dg-message "note" }
int test2_46()
{
......@@ -299,8 +299,8 @@ int test2_46()
return 0;
}
four sink_2_47(const volatile A&); // { dg-error "" }
seven sink_2_47(volatile A&&); // { dg-error "" }
four sink_2_47(const volatile A&); // { dg-message "candidate" }
seven sink_2_47(volatile A&&); // { dg-message "note" }
int test2_47()
{
......@@ -313,8 +313,8 @@ int test2_47()
return 0;
}
five sink_2_56( A&&); // { dg-error "" }
six sink_2_56(const A&&); // { dg-error "" }
five sink_2_56( A&&); // { dg-message "candidate" }
six sink_2_56(const A&&); // { dg-message "note" }
int test2_56()
{
......@@ -329,8 +329,8 @@ int test2_56()
return 0;
}
five sink_2_57( A&&); // { dg-error "" }
seven sink_2_57(volatile A&&); // { dg-error "" }
five sink_2_57( A&&); // { dg-message "candidate" }
seven sink_2_57(volatile A&&); // { dg-message "note" }
int test2_57()
{
......@@ -345,8 +345,8 @@ int test2_57()
return 0;
}
six sink_2_67(const A&&); // { dg-error "" }
seven sink_2_67(volatile A&&); // { dg-error "" }
six sink_2_67(const A&&); // { dg-message "candidate" }
seven sink_2_67(volatile A&&); // { dg-message "note" }
int test2_67()
{
......
// I, Howard Hinnant, hereby place this code in the public domain.
// Test overlaod resolution among referece types
// Test overload resolution among reference types
// { dg-do compile }
// { dg-options "-std=c++0x" }
......@@ -30,13 +30,13 @@ const volatile A cv_source();
// 7 at a time
one sink_7_1234567( A&); // { dg-error "" }
two sink_7_1234567(const A&); // { dg-error "" }
three sink_7_1234567(volatile A&); // { dg-error "" }
four sink_7_1234567(const volatile A&); // { dg-error "" }
five sink_7_1234567( A&&); // { dg-error "" }
six sink_7_1234567(const A&&); // { dg-error "" }
seven sink_7_1234567(volatile A&&); // { dg-error "" }
one sink_7_1234567( A&); // { dg-message "candidates" }
two sink_7_1234567(const A&); // { dg-message "note" }
three sink_7_1234567(volatile A&); // { dg-message "note" }
four sink_7_1234567(const volatile A&); // { dg-message "note" }
five sink_7_1234567( A&&); // { dg-message "note" }
six sink_7_1234567(const A&&); // { dg-message "note" }
seven sink_7_1234567(volatile A&&); // { dg-message "note" }
int test7_1234567()
{
......@@ -48,13 +48,13 @@ int test7_1234567()
return 0;
}
two sink_7_2345678(const A&); // { dg-error "" }
three sink_7_2345678(volatile A&); // { dg-error "" }
four sink_7_2345678(const volatile A&); // { dg-error "" }
five sink_7_2345678( A&&); // { dg-error "" }
six sink_7_2345678(const A&&); // { dg-error "" }
seven sink_7_2345678(volatile A&&); // { dg-error "" }
eight sink_7_2345678(const volatile A&&); // { dg-error "" }
two sink_7_2345678(const A&); // { dg-message "candidates" }
three sink_7_2345678(volatile A&); // { dg-message "note" }
four sink_7_2345678(const volatile A&); // { dg-message "note" }
five sink_7_2345678( A&&); // { dg-message "note" }
six sink_7_2345678(const A&&); // { dg-message "note" }
seven sink_7_2345678(volatile A&&); // { dg-message "note" }
eight sink_7_2345678(const volatile A&&); // { dg-message "note" }
int test7_2345678()
{
......@@ -67,12 +67,12 @@ int test7_2345678()
}
one sink_7_1234678( A&);
two sink_7_1234678(const A&); // { dg-error "" }
two sink_7_1234678(const A&); // { dg-message "candidates" }
three sink_7_1234678(volatile A&);
four sink_7_1234678(const volatile A&);
six sink_7_1234678(const A&&); // { dg-error "" }
seven sink_7_1234678(volatile A&&); // { dg-error "" }
eight sink_7_1234678(const volatile A&&); // { dg-error "" }
six sink_7_1234678(const A&&); // { dg-message "note" }
seven sink_7_1234678(volatile A&&); // { dg-message "note" }
eight sink_7_1234678(const volatile A&&); // { dg-message "note" }
int test7_1234678()
{
......
......@@ -34,6 +34,6 @@ template<typename... Args> void g(Args... args)
f(const_cast<const Args*>(&args)...); // okay: ``Args'' and ``args'' are expanded
f(5 ...); // { dg-error "contains no argument packs" }
f(args); // { dg-error "parameter packs not expanded" }
// { dg-error "args" "" { target *-*-* } 36 }
// { dg-message "args" "note" { target *-*-* } 36 }
f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f.
}
......@@ -11,5 +11,5 @@ struct tuple_base { };
template<typename... Values>
struct tuple : tuple_base<Values> { }; // { dg-error "packs not expanded" }
// { dg-error "args" "" { target *-*-* } 5 }
// { dg-error "Values" "" { target *-*-* } 12 }
// { dg-message "args" "note" { target *-*-* } 5 }
// { dg-message "Values" "note" { target *-*-* } 12 }
// { dg-options "-std=gnu++0x" }
template<class T, typename... VarArgs>
void print(T t, VarArgs args); // { dg-error "packs not expanded" }
// { dg-error "VarArgs" "" { target *-*-* } 3 }
// { dg-message "VarArgs" "note" { target *-*-* } 3 }
......@@ -9,4 +9,4 @@ struct push_front<list<Elements...>, Head> {
typedef list<Head, Elements> type; // { dg-error "parameter packs not expanded" }
};
// { dg-error "Elements" "" { target *-*-* } 9 }
// { dg-message "Elements" "note" { target *-*-* } 9 }
// PR c++/27666
struct A { // { dg-error "A" }
A(int); // { dg-error "A" }
struct A { // { dg-message "A" }
A(int); // { dg-message "A" }
};
void foo(volatile A a) {
......
......@@ -7,13 +7,13 @@
struct A
{
void f();
void foo(void (A::*)(int)); // { dg-error "candidate" "" }
void foo(void (A::*)(int)); // { dg-message "candidate" "" }
template<typename T>
void g(T);
void h()
{
void (A::*p)() = &A::f;
void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" }
foo(&g<int>); // { dg-error "" "" }
foo(&g<int>); // { dg-error "no matching" "" }
}
};
......@@ -11,7 +11,7 @@ T f2 (T i)
{
switch (i)
{
case low ... high : return i + 1; // { dg-error "" }
case low ... high : return i + 1; // { dg-error "previously" }
case 5 : return i + 2; // { dg-error "duplicate" }
default : return 0;
}
......@@ -20,8 +20,8 @@ T f2 (T i)
int f (int i)
{
switch (i) {
case 1 ... 10: return i + 1; // { dg-error "" }
case 1 ... 10: return i + 1; // { dg-error "first entry" }
case 3 ... 5 : return i + 3; // { dg-error "duplicate" }
default: return f2 (i); // { dg-error "" }
default: return f2 (i); // { dg-message "instantiated" }
}
}
......@@ -9,7 +9,7 @@ T f2 (T i)
{
switch (i)
{
case low ... high : return i + 1; // { dg-error "non-standard" }
case low ... high : return i + 1; // { dg-warning "non-standard" }
default : return 0;
}
}
......@@ -17,7 +17,7 @@ T f2 (T i)
int f (int i)
{
switch (i) {
case 1 ... 10: return i + 1; // { dg-error "non-standard" }
default: return f2 (i); // { dg-error "" }
case 1 ... 10: return i + 1; // { dg-warning "non-standard" }
default: return f2 (i); // { dg-message "instantiated" }
}
}
......@@ -13,7 +13,7 @@ template<int> void foo()
__is_abstract(int)(); // { dg-error "'__is_abstract\\(int\\)' cannot be used" }
__is_base_of(int, float)(); // { dg-error "'__is_base_of\\(int, float\\)' cannot be used" }
__is_class(int)(); // { dg-error "'__is_class\\(int\\)' cannot be used" }
__is_convertible_to(int, float)(); // { dg-error "unimplemented" }
__is_convertible_to(int, float)(); // { dg-message "unimplemented" }
__is_empty(int)(); // { dg-error "'__is_empty\\(int\\)' cannot be used" }
__is_enum(int)(); // { dg-error "'__is_enum\\(int\\)' cannot be used" }
__is_pod(int)(); // { dg-error "'__is_pod\\(int\\)' cannot be used" }
......
......@@ -4,4 +4,4 @@
struct A { };
int main() { b: A() && && b; } // { dg-error "A\\(\\) && && *b" }
// { dg-error "candidate" "additional" { target *-*-* } 5 }
// { dg-message "candidate" "additional" { target *-*-* } 5 }
......@@ -8,4 +8,4 @@ struct A
int z[1];
};
A a = { z:{} }; // { dg-error "unimplemented" }
A a = { z:{} }; // { dg-message "unimplemented" }
......@@ -2,8 +2,8 @@
// { dg-do compile }
struct A
{ // { dg-error "A::A\\(const A&\\)" }
A (int); // { dg-error "candidates" }
{ // { dg-message "A::A\\(const A&\\)" }
A (int); // { dg-message "candidates" }
};
void
......
......@@ -3,8 +3,8 @@
struct A
{
A (int x = 6); // { dg-error "A::A\\(int\\)" }
A (long long x = 12LL); // { dg-error "candidates" }
A (int x = 6); // { dg-message "A::A\\(int\\)" }
A (long long x = 12LL); // { dg-message "candidates" }
};
void
......
......@@ -9,7 +9,7 @@ foo ()
{
#pragma omp parallel
{
int j; // { dg-warning "note: 'j' was declared here" }
int j; // { dg-message "note: 'j' was declared here" }
i = j; // { dg-warning "is used uninitialized" }
}
}
......@@ -17,4 +17,4 @@ void S<T>::test()
template struct S<int>;
template struct S<long>;
template struct S<float>; // { dg-error "instantiated from here" }
template struct S<float>; // { dg-message "instantiated from here" }
......@@ -5,4 +5,4 @@ template<typename T> struct A : T {}; // { dg-error "struct or class type" }
struct B;
A<void (B::*)()> a; // { dg-error "instantiated" }
A<void (B::*)()> a; // { dg-message "instantiated" }
......@@ -12,4 +12,4 @@ template <typename T> struct TPL : A
};
TPL<int> i;
TPL<float> j; // { dg-error "instantiated" }
TPL<float> j; // { dg-message "instantiated" }
......@@ -6,7 +6,7 @@ struct A {
};
struct B {
B(const B&); // { dg-error "candidate" }
B(const B&); // { dg-message "candidate" }
int b;
};
......
......@@ -16,5 +16,5 @@ foo::foo() {
int main(int argc, char **argv)
{
bar x; // { dg-error "synthesized" }
bar x; // { dg-message "synthesized" }
}
......@@ -7,12 +7,12 @@
struct A1
{
operator int () const; // { dg-error "A1::operator" "" }
operator int () const; // { dg-message "A1::operator" "" }
};
struct A2
{
operator int () const; // { dg-error "A2::operator" "" }
operator int () const; // { dg-message "A2::operator" "" }
};
struct B : A1, A2
......
......@@ -10,4 +10,4 @@ int main() {
return 0;
}
// { dg-error "candidate" "" { target *-*-* } 0 }
// { dg-message "candidate" "" { target *-*-* } 0 }
......@@ -10,7 +10,7 @@ public:
class Bar {
Foo<int> foo_;
public:
Bar() {} // { dg-error "instantiated" }
Bar() {} // { dg-message "instantiated" }
};
template class Foo<int>;
......
......@@ -4,8 +4,9 @@ template <typename T, bool=T::X> struct A
};
template <typename T> struct B : A<T>
{ // { dg-error "" }
using A<T>::i; // { dg-error "" }
{ // { dg-error "incomplete" }
using A<T>::i; // { dg-error "incomplete" "incomplete" }
// { dg-error "using" "using" { target *-*-* } 8 }
};
B<void> b; // { dg-error "" }
B<void> b; // { dg-message "instantiated" }
......@@ -4,14 +4,14 @@
// an ambiguous overload set to be created.
namespace B {
void f(int); // { dg-error "note" }
void f(double); // { dg-error "note" }
void f(int); // { dg-message "candidates" }
void f(double); // { dg-message "note" }
}
namespace C {
void f(int); // { dg-error "note" }
void f(double); // { dg-error "note" }
void f(char); // { dg-error "note" }
void f(int); // { dg-message "note" }
void f(double); // { dg-message "note" }
void f(char); // { dg-message "note" }
}
void h()
......
......@@ -5,7 +5,7 @@
// c++/9256: Make sure that a pointer to an array of abstract elements
// cannot be created, not even during template substitution (DR337).
struct Abstract { virtual void f() = 0; }; // { dg-error "" }
struct Abstract { virtual void f() = 0; }; // { dg-message "note" }
struct Complete { void f(); };
......@@ -35,7 +35,7 @@ template <class T> struct K {
T (*a)[2]; // { dg-error "abstract class type" }
};
template struct K<Abstract>; // { dg-error "from here" }
template struct K<Abstract>; // { dg-message "instantiated" }
......
......@@ -19,22 +19,22 @@ namespace N1 {
void g(X (*parm6)[2]); // { dg-error "abstract" }
};
struct X { // { dg-error "note" }
virtual void xfunc(void) = 0; // { dg-error "note" }
struct X { // { dg-message "note" }
virtual void xfunc(void) = 0; // { dg-message "note" }
};
}
namespace N2 {
struct X1 { // { dg-error "note" }
virtual void xfunc(void) = 0; // { dg-error "note" }
struct X1 { // { dg-message "note" }
virtual void xfunc(void) = 0; // { dg-message "note" }
void g(X1 parm7); // { dg-error "abstract" }
void g(X1 parm8[2]); // { dg-error "abstract" }
void g(X1 (*parm9)[2]); // { dg-error "abstract" }
};
template <int N>
struct X2 { // { dg-error "note" }
virtual void xfunc(void) = 0; // { dg-error "note" }
struct X2 { // { dg-message "note" }
virtual void xfunc(void) = 0; // { dg-message "note" }
void g(X2 parm10); // { dg-error "abstract" }
void g(X2 parm11[2]); // { dg-error "abstract" }
void g(X2 (*parm12)[2]); // { dg-error "abstract" }
......@@ -42,8 +42,8 @@ namespace N2 {
}
namespace N3 {
struct X { // { dg-error "note" "" }
virtual void xfunc(void) = 0; // { dg-error "note" }
struct X { // { dg-message "note" "" }
virtual void xfunc(void) = 0; // { dg-message "note" }
};
void g(X parm13); // { dg-error "abstract" }
void g(X parm14[2]); // { dg-error "abstract" }
......
......@@ -11,7 +11,7 @@ namespace {
const bool &f()
{
return c::t; // { dg-error "undefined" "undefined" { target *-*-* } 0 }
return c::t; // { dg-message "undefined" "undefined" { target *-*-* } 0 }
// Some targets report the error for the previous line, others
// don't give line number inforamtion for it, so use line 0.
}
......
......@@ -22,5 +22,5 @@ struct b
struct c
{
b bb;
c(const b& __a): bb(__a) {} // { dg-error "synthesized" "" { target { ! default_packed } } }
c(const b& __a): bb(__a) {} // { dg-message "synthesized" "" { target { ! default_packed } } }
};
......@@ -10,6 +10,6 @@ void foo(const A<N> &a)
void bar()
{
foo(A<0>()); // { dg-error "instantiated from here" "" }
foo(A<0>()); // { dg-message "instantiated from here" "" }
}
//PR c++/28258
struct A
{ // { dg-error "" }
{ // { dg-message "note" }
A(void x); // { dg-error "invalid use|incomplete type|candidates" }
};
struct B : A {}; // { dg-error "no matching function for call" }
B b; // { dg-error "synthesized method" }
B b; // { dg-message "synthesized method" }
......@@ -2,7 +2,7 @@
// { dg-do compile }
struct A
{ // { dg-error "candidates" }
{ // { dg-message "candidates" }
virtual A foo ();
};
......
......@@ -10,4 +10,4 @@ template <typename T> struct S2 : S<T> {
using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" }
};
template struct S2<int>; // { dg-error "instantiated" "" }
template struct S2<int>; // { dg-message "instantiated" "" }
......@@ -22,4 +22,4 @@ template <> struct X<int> {
X();
};
X<float> i; // { dg-error "instantiated from" "" }
X<float> i; // { dg-message "instantiated from" "" }
......@@ -19,4 +19,4 @@ struct S
static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" }
};
int k = S<int>::j; // { dg-warning "instantiated from here" }
int k = S<int>::j; // { dg-message "instantiated from here" }
......@@ -5,6 +5,7 @@
struct A
{
struct B { int i; } // { dg-error "3: error: new types may not be defined in a return type|note: \\(perhaps a semicolon is missing" }
void foo(); // { dg-error "12: error: two or more|return type" }
struct B { int i; } // { dg-error "3:new types may not be defined in a return type" }
// { dg-message "perhaps a semicolon is missing" "note" { target *-*-* } 8 }
void foo(); // { dg-error "12:two or more" }
};
......@@ -14,8 +14,8 @@ struct B
B(int);
};
void f(A); // { dg-error "" "candidate" }
void f(B); // { dg-error "" "candidate" }
void f(A); // { dg-message "note" "candidate" }
void f(B); // { dg-message "note" "candidate" }
int main()
{
......
......@@ -10,13 +10,14 @@ struct A {};
struct B : A
{
B(int); // { dg-error "" "" }
B(B&); // { dg-error "" "" }
B(int); // { dg-message "B::B" "" }
B(B&); // { dg-message "candidates" "" }
};
void foo(B);
void bar()
{
foo(0); // { dg-error "no matching function|initializing" "" }
foo(0); // { dg-error "no matching function" "no matching" }
// { dg-error "initializing" "initializing" { target *-*-* } 21 }
}
......@@ -7,10 +7,11 @@ struct A {
operator B ();
};
void operator+ (B, B); // { dg-error "" "candidate" }
void operator+ (B, B); // { dg-message "operator" "operator" }
int main ()
{
A a;
a + a; // { dg-error "" "ambiguous" }
a + a; // { dg-error "ambiguous" "ambiguous" }
// { dg-message "candidates" "candidates" { target *-*-* } 15 }
}
......@@ -4,8 +4,8 @@ struct A;
struct B
{
B (A const &); // { dg-warning "note" }
B (B &); // { dg-warning "note" }
B (A const &); // { dg-message "note" }
B (B &); // { dg-message "note" }
};
struct A
......@@ -16,5 +16,6 @@ struct A
B
f (B const& b)
{
return b; // { dg-error "" }
return b; // { dg-error "matching" "matching" }
// { dg-error "initializing" "initializing" { target *-*-* } 19 }
}
......@@ -16,6 +16,6 @@ void f(X *x = new X[4]); // { dg-error "" }
void f(X *x = new (3) X(6)); // { dg-error "" }
void f(X *x = new (2) X[10]); // { dg-error "" }
// { dg-error "candidate" "" { target *-*-* } 00 }
// { dg-message "candidate" "" { target *-*-* } 00 }
void f(X *x = new X[10][5]); // { dg-error "" }
......@@ -3,14 +3,14 @@
namespace
{
template <int> void foo (...); // { dg-error "" "candidate" }
template <int> void bar (int, ...); // { dg-error "" "candidate" }
void baz (...); // { dg-error "" "candidate" }
template <int> void foo (...); // { dg-message "foo" }
template <int> void bar (int, ...); // { dg-message "bar" }
void baz (...); // { dg-message "baz" }
}
template <int> void foo (...); // { dg-error "" "candidate" }
template <int> void bar (int, ...); // { dg-error "" "candidate" }
void baz (...); // { dg-error "" "candidate" }
template <int> void foo (...); // { dg-message "candidate" }
template <int> void bar (int, ...); // { dg-message "candidate" }
void baz (...); // { dg-message "candidate" }
void
test ()
......
......@@ -20,21 +20,21 @@ namespace std {
extern "C" void *malloc (__SIZE_TYPE__) throw () __attribute__((malloc));
void abort (void) throw (); // these aren't
void _exit (int) throw (); // { dg-error "std::_exit" }
void _exit (int) throw (); // { dg-message "std::_exit" }
extern "C" void c1 (void) throw ();
void C1 (void) throw (); // { dg-error "std::C1" }
void C1 (void) throw (); // { dg-message "std::C1" }
extern "C" void c2 (void) throw ();
void C2 (void) throw ();
extern "C" void c3 (void) throw ();
void C3 (void) throw (); // { dg-error "std::C3" }
void C3 (void) throw (); // { dg-message "std::C3" }
}
namespace other {
extern "C" void c3 (void) throw ();
void C3 (void) throw (); // { dg-error "other::C3" }
void C3 (void) throw (); // { dg-message "other::C3" }
}
using std::exit;
......@@ -46,10 +46,12 @@ using std::C1;
extern "C" void *malloc (__SIZE_TYPE__) throw () __attribute__((malloc));
void abort (void) throw ();
void _exit (int) throw (); // { dg-error "conflicts|void _exit" }
void _exit (int) throw (); // { dg-error "conflicts" "conflicts" }
// { dg-message "void _exit" "_exit" { target *-*-* } 49 }
extern "C" void c1 (void) throw ();
void C1 (void) throw (); // { dg-error "conflicts|void C1" }
void C1 (void) throw (); // { dg-error "conflicts" "conflicts" }
// { dg-message "void C1" "C1" { target *-*-* } 53 }
extern "C" void c2 (void) throw ();
void C2 (void) throw ();
......
......@@ -22,7 +22,7 @@ struct D
T t : 3; // { dg-error "non-integral type" }
};
D<double> d; // { dg-error "instantiated" }
D<double> d; // { dg-message "instantiated" }
template <typename T>
struct E
......
......@@ -34,7 +34,7 @@ template <typename> struct X
void Baz ()
{
Foo<int> (); // { dg-error "instantiated" "" }
Foo<int> (); // { dg-message "instantiated" "" }
}
// { dg-do compile }
// { dg-options "-fshow-column" }
ACE_Process_Descriptor::ACE_Process_Descriptor () : // { dg-error "" }
process_ (0) // { dg-error "3: error: only constructors take base initializers" }
ACE_Process_Descriptor::ACE_Process_Descriptor () : // { dg-error "declared" "declared" }
// { dg-error "no type" "no type" { target *-*-* } 4 }
process_ (0) // { dg-error "3: only constructors take base initializers" }
{
}
......@@ -11,4 +11,4 @@ template<typename T> struct A
typedef typename T::X Y; // { dg-error "not a class" "" }
};
A<int>::Y y; // { dg-error "instantiated from here" "" }
A<int>::Y y; // { dg-message "instantiated from here" "" }
......@@ -2,9 +2,10 @@
// { dg-do compile }
// { dg-options "-std=c++98" }
template <typename... T> struct A // { dg-error "variadic templates" }
template <typename... T> struct A // { dg-warning "variadic templates" }
{
static T &t; // { dg-error "not expanded with|T" }
static T &t; // { dg-error "not expanded with" "not expanded" }
// { dg-message "T" "T" { target *-*-* } 7 }
static const int i = sizeof (++t); // { dg-error "was not declared in this scope" }
};
......
// { dg-options "-w" }
class QString { // { dg-error "" }
QString (const QString & a); // { dg-error "" }
class QString { // { dg-error "previous definition" }
QString (const QString & a); // { dg-message "candidates" }
};
class QString { }; // { dg-error "" }
class QString { }; // { dg-error "redefinition" }
const QString q () {
QString z; // { dg-error "" }
QString z; // { dg-error "matching" }
int x;
return x ? QString () : QString (); // { dg-error "" }
return x ? QString () : QString (); // { dg-error "matching" }
}
......@@ -5,5 +5,5 @@
void foo ()
{
cout << "blah"; // { dg-error "3: error: 'cout'" }
cout << "blah"; // { dg-error "3:'cout'" }
}
......@@ -3,5 +3,5 @@ struct INCOMPLETE;
template <int> struct X {
static INCOMPLETE value;
};
template <> INCOMPLETE X<1>::value = 0; // { dg-error "30: error: variable 'INCOMPLETE X<1>::value' has initializer but incomplete type" }
template <> INCOMPLETE X<1>::value = 0; // { dg-error "30:variable 'INCOMPLETE X<1>::value' has initializer but incomplete type" }
......@@ -15,5 +15,5 @@ template <typename T> void foo()
}
// Here, columns nums are not very accurate either. Still acceptable though
// { dg-error "30: error: invalid type in declaration before ';' token" "" { target *-*-* } { 14 } }
// { dg-error "30: error: two or more data types in declaration of 'e4'" "" { target *-*-* } { 14 } }
// { dg-error "30:invalid type in declaration before ';' token" "" { target *-*-* } 14 }
// { dg-error "30:two or more data types in declaration of 'e4'" "" { target *-*-* } 14 }
......@@ -16,45 +16,56 @@ struct Foo
};
void method(void) {
typename Foo<::B>::template Nested<::B> n; // { dg-error "17: error: '<::' cannot begin|17: note: '<:' is an alternate spelling|39: error: '<::' cannot begin|39: note: '<:' is an alternate" }
typename Foo<::B>::template Nested<::B> n; // { dg-error "17:'<::' cannot begin" "17-begin" }
// { dg-message "17:'<:' is an alternate spelling" "17-alt" { target *-*-* } 19 }
// { dg-error "39:'<::' cannot begin" "39-begin" { target *-*-* } 19 }
// { dg-message "39:'<:' is an alternate spelling" "39-alt" { target *-*-* } 19 }
n.template Nested<B>::method();
n.template Nested<::B>::method(); // { dg-error "22: error: '<::' cannot begin|22: note: '<:' is an alternate" }
n.template Nested<::B>::method(); // { dg-error "22:'<::' cannot begin" "error" }
// { dg-message "22:'<:' is an alternate" "note" { target *-*-* } 24 }
Nested<B>::method();
Nested<::B>::method(); // { dg-error "11: error: '<::' cannot begin|11: note: '<:' is an alternate" }
Nested<::B>::method(); // { dg-error "11:'<::' cannot begin" "error" }
// { dg-message "11:'<:' is an alternate" "note" { target *-*-* } 27 }
}
};
template <int N> struct Foo2 {};
template struct Foo2<::B>; // { dg-error "21: error: '<::' cannot begin|21: note: '<:' is an alternate|25: error: type/value mismatch|25: error: expected a constant" }
template struct Foo2<::B>; // { dg-error "21:'<::' cannot begin" "begin" }
// { dg-message "21:'<:' is an alternate" "alt" { target *-*-* } 33 }
// { dg-message "25:type/value mismatch" "mismatch" { target *-*-* } 33 }
// { dg-error "25:expected a constant" "const" { target *-*-* } 33 }
int value = 0;
void func(void)
{
Foo<::B> f; // { dg-error "cannot begin|alternate spelling" }
Foo<::B> f; // { dg-error "cannot begin" "begin" }
// { dg-message "alternate spelling" "alt" { target *-*-* } 42 }
f.Foo<B>::method();
f.Foo<::B>::method(); // { dg-error "8: error|8: note" }
f.Foo<::B>::method(); // { dg-error "8:cannot begin" "begin" }
// { dg-message "8:alternate spelling" "alt" { target *-*-* } 45 }
// Check cases where we the token sequence is the correct one, but there
// was no digraph or whitespaces in the middle, so we should not emit
// the special error message.
Foo<: :B> k2; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
Foo[:B> k1; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
// { dg-error "6: error: missing template arguments before" "" { target *-*-* } { 41 } }
// { dg-error "9: error: expected primary-expression before ':' token" "" { target *-*-* } 41 }
// { dg-error "9: error: expected '\]' before ':' token" "" { target *-*-* } 41 }
// { dg-error "9: error: expected ';' before ':' token" "" { target *-*-* } 41 }
// { dg-error "6: error: missing template arguments before" "" { target *-*-* } 42 }
// { dg-error "7: error: expected primary-expression before ':' token" "" { target *-*-* } 42 }
// { dg-error "7: error: expected '\]' before ':' token" "" { target *-*-* } 42 }
// { dg-error "7: error: expected ';' before ':' token" "" { target *-*-* } 42 }
// { dg-error "6:missing template arguments before" "template" { target *-*-* } { 51 } }
// { dg-error "9:expected primary-expression before ':' token" "primary" { target *-*-* } 51 }
// { dg-error "9:expected '\]' before ':' token" "backslash" { target *-*-* } 51 }
// { dg-error "9:expected ';' before ':' token" "semicolon" { target *-*-* } 51 }
// { dg-error "6:missing template arguments before" "template" { target *-*-* } 52 }
// { dg-error "7:expected primary-expression before ':' token" "primary" { target *-*-* } 52 }
// { dg-error "7:expected '\]' before ':' token" "backslash" { target *-*-* } 52 }
// { dg-error "7:expected ';' before ':' token" "semicolon" { target *-*-* } 52 }
//
int Foo[2];
Foo[::value] = 0;
}
template struct Foo<::B>; // { dg-error "20: error: '<::' cannot begin|20: note: '<:' is an alternate" }
template struct Foo<::B>; // { dg-error "20:'<::' cannot begin" "begin" }
// { dg-message "20:is an alternate" "alt" { target *-*-* } 66 }
// On the first error message, an additional note about the use of
// -fpermissive should be present
// { dg-error "17: note: \\(if you use '-fpermissive' G\\+\\+ will accept your code\\)" "-fpermissive" { target *-*-* } 19 }
// { dg-message "17:\\(if you use '-fpermissive' G\\+\\+ will accept your code\\)" "-fpermissive" { target *-*-* } 19 }
......@@ -9,5 +9,5 @@ template <class A>
struct Foo {};
Foo<::B> foo; // { dg-bogus "error" "error in place of warning" }
// { dg-error "4: warning: '<::' cannot begin a template-argument list" "warning <::" { target *-*-* } 11 }
// { dg-error "4: note: '<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target *-*-* } 11 }
// { dg-warning "4: '<::' cannot begin a template-argument list" "warning <::" { target *-*-* } 11 }
// { dg-message "4:'<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target *-*-* } 11 }
// { dg-options "-fshow-column" }
// PR c++/13975
public: // { dg-error "1: error: expected unqualified-id before 'public'" }
public: // { dg-error "1:expected unqualified-id before 'public'" }
int i;
protected: // { dg-error "1: error: expected unqualified-id before 'protected'" }
protected: // { dg-error "1:expected unqualified-id before 'protected'" }
int j;
private: // { dg-error "1: error: expected unqualified-id before 'private'" }
private: // { dg-error "1:expected unqualified-id before 'private'" }
int k;
......@@ -19,5 +19,8 @@ struct X
Zinc<int>( //);
// }
}; // { dg-error "2: error: expected '.' at end of input|1: error: expected primary-expression before '.' token|1: error: expected ';' before '.' token|1: error: expected unqualified-id at end of input" }
}; // { dg-error "2:expected '.' at end of input" "at end of input" }
// { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } 22 }
// { dg-error "1:expected ';' before '.' token" "semicolon" { target *-*-* } 22 }
// { dg-error "1:expected unqualified-id at end of input" "unqual" { target *-*-* } 22 }
......@@ -10,29 +10,32 @@ namespace N
int K;
}
N::A f2; // { dg-error "1: error: invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "1: error: 'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "1: error: 'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "1: error: 'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "1: error: using 'typename' outside of template|13: error: invalid use of template-name 'N::A' without an argument list|17: error: invalid type in declaration before ';' token" }
N::A f2; // { dg-error "1:invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "1:'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "1:'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "1:'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "1:using 'typename' outside of template" "1" }
// { dg-error "13:invalid use of template-name 'N::A' without an argument list" "13" { target *-*-* } 17 }
// { dg-error "17:invalid type in declaration before ';' token" "17" { target *-*-* } 17 }
struct B
{
N::A f2; // { dg-error "3: error: invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "3: error: 'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "3: error: 'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "3: error: 'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "3: error: using 'typename' outside of template|15: error: invalid use of template-name 'N::A' without an argument list" }
N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "3:using 'typename' outside of template" }
// { dg-error "15:invalid use of template-name 'N::A' without an argument list" "15" { target *-*-* } 27 }
};
template <int>
struct C
{
N::A f2; // { dg-error "3: error: invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "3: error: 'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "3: error: 'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "3: error: 'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "15: error: invalid use of template-name 'N::A' without an argument list" }
N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" }
N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" }
N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "15:invalid use of template-name 'N::A' without an argument list" }
};
// { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { target *-*-* } 17 }
......@@ -3,7 +3,7 @@
struct A
{
struct B {}; // { dg-error "12: error: previous definition of 'struct A::B'" }
struct B {}; // { dg-error "12:previous definition of 'struct A::B'" }
};
struct A::B{}; // { dg-error "11: error: redefinition of 'struct A::B'" }
struct A::B{}; // { dg-error "11:redefinition of 'struct A::B'" }
......@@ -2,8 +2,10 @@
// PR c++/16965
template <typename T> struct B {
static int Bar(T); // { dg-error "14: error: candidates are: |14: error: " }
static int Bar(T); // { dg-error "14:candidates are: " "1" }
// { dg-error "14:with T = int" "2" { target *-*-* } 5 }
};
struct D : B<int>, B<char> {};
int i2 = D::Bar(2); // { dg-error "13: error: reference to 'Bar' is ambiguous|10: error: reference to 'Bar' is ambiguous" }
int i2 = D::Bar(2); // { dg-error "13:reference to 'Bar' is ambiguous" }
// { dg-error "10:reference to 'Bar' is ambiguous" "2" { target *-*-* } 10 }
......@@ -3,6 +3,6 @@
void f()
{
double Q *= 5.0; // { dg-error "12: error: expected initializer before '..' token" }
double Q *= 5.0; // { dg-error "12:expected initializer before '..' token" }
}
......@@ -2,7 +2,7 @@
// PR C++/17867
struct A
{ // { dg-error "1: note: candidates are:" }
{ // { dg-message "1:candidates are:" }
A(int);
};
......@@ -10,5 +10,5 @@ const A& foo();
void bar()
{
foo()=A(0); // { dg-error "12: error: no match for 'operator='" }
foo()=A(0); // { dg-error "12:no match for 'operator='" }
}
......@@ -8,8 +8,8 @@ int func(double);
template <int>
struct Foo {};
Foo<func(g)> f; // { dg-error "5: error: 'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } { 11 } }
// { dg-error "10: error: 'g' cannot appear in a constant-expression" "" { target *-*-* } { 11 } }
// { dg-error "11: error: a function call cannot appear in a constant-expression" "" { target *-*-* } { 11 } }
// { dg-error "12: error: template argument 1 is invalid" "" { target *-*-* } { 11 } }
// { dg-error "15: error: invalid type in declaration before ';' token" "" { target *-*-* } { 11 } }
Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } 11 }
// { dg-error "10:'g' cannot appear in a constant-expression" "" { target *-*-* } 11 }
// { dg-error "11:a function call cannot appear in a constant-expression" "" { target *-*-* } 11 }
// { dg-error "12:template argument 1 is invalid" "" { target *-*-* } 11 }
// { dg-error "15:invalid type in declaration before ';' token" "" { target *-*-* } 11 }
......@@ -12,7 +12,7 @@ struct C {
};
int main() {
C c;
A(c.p.i); // { dg-error "9: error: request for member 'i' in 'c.C::p', which is of non-class type 'B" }
A(c.p.i); // { dg-error "9:request for member 'i' in 'c.C::p', which is of non-class type 'B" }
return 0;
}
......@@ -7,6 +7,7 @@ void foo()
{
// Check that we do not complain about an unused
// compiler-generated variable.
A& = a; // { dg-error "6: error: expected unqualified-id before '=' token|8: error: 'a' was not declared in this scope" }
A& = a; // { dg-error "6:expected unqualified-id before '=' token" "6" }
// { dg-error "8:'a' was not declared in this scope" "8" { target *-*-* } 10 }
}
......@@ -2,5 +2,5 @@
// PR c++/15786
struct A {
void foo(bar* p); /* { dg-error "12: error: 'bar' has not been declared" } */
void foo(bar* p); /* { dg-error "12:'bar' has not been declared" } */
};
......@@ -5,5 +5,5 @@ struct QChar {
QChar( char c );
QChar( const QChar& c );
//following column number is not accurate enough but will make it for now
static const ; // { dg-error "10: error: declaration does not declare anything" }
static const ; // { dg-error "10:declaration does not declare anything" }
};
......@@ -2,7 +2,7 @@
// PR c++/19395
struct A {
typedef int ::X; // { dg-error "17: error: typedef name may not be a nested-name-specifier" }
typedef int ::X; // { dg-error "17:typedef name may not be a nested-name-specifier" }
};
......@@ -9,10 +9,10 @@
class foo
{
virtual void bar1 () = 0;
virtual void bar2 () = __null; // { dg-error "32: error: invalid pure specifier" }
virtual void bar3 () = 4; // { dg-error "27: error: invalid pure specifier" }
virtual void bar4 () = A::f; // { dg-error "27: error: invalid pure specifier" }
virtual void bar5 () = 0l; // { dg-error "28: error: invalid pure specifier" }
virtual void bar6 () = 00; // { dg-error "28: error: invalid pure specifier" }
virtual void bar7 () = 0x0; // { dg-error "29: error: invalid pure specifier" }
virtual void bar2 () = __null; // { dg-error "32:invalid pure specifier" }
virtual void bar3 () = 4; // { dg-error "27:invalid pure specifier" }
virtual void bar4 () = A::f; // { dg-error "27:invalid pure specifier" }
virtual void bar5 () = 0l; // { dg-error "28:invalid pure specifier" }
virtual void bar6 () = 00; // { dg-error "28:invalid pure specifier" }
virtual void bar7 () = 0x0; // { dg-error "29:invalid pure specifier" }
};
......@@ -3,10 +3,12 @@
void foo()
{
if (({int c[2];})) ; // { dg-error "7: error: ISO C.. forbids|20: error: could not convert" }
if (({int c[2];})) ; // { dg-error "7:ISO C.. forbids" "7" }
// { dg-error "20:could not convert" "20" { target *-*-* } 6 }
}
void bar()
{
if (({})); // { dg-error "7: error: ISO C.. forbids|11: error: could not convert" }
if (({})); // { dg-error "7:ISO C.. forbids" "7" }
// { dg-error "11:could not convert" "11" { target *-*-* } 12 }
}
// { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" }
// PR c++/20152
struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "24: error: previous definition of 'struct KrSelectionMode'" }
struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "52: error: previous definition of 'struct KrKDESelectionMode'" }
struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "8: error: redefinition of 'struct KrSelectionMode'" }
struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "8: error: redefinition of 'struct KrKDESelectionMode'" }
struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "24:previous definition of 'struct KrSelectionMode'" }
struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "52:previous definition of 'struct KrKDESelectionMode'" }
struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "8:redefinition of 'struct KrSelectionMode'" }
struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "8:redefinition of 'struct KrKDESelectionMode'" }
KrKDESelectionMode krKDESelectionMode;
......@@ -2,10 +2,10 @@
// PR c++/21908
struct virt { virt () {} virt (int i) {} };
struct der : public virtual virt { // { dg-error "34: note: der::der" }
der (int i) : virt(i) {} // { dg-error "3: note: candidates are: der" }
struct der : public virtual virt { // { dg-message "34:der::der" }
der (int i) : virt(i) {} // { dg-message "3:candidates are: der" }
};
struct top : public der {
top () {} // { dg-bogus "der\\(const" }
};
// { dg-error "10: error: no matching function for call to 'der" "" { target *-*-* } 9 }
// { dg-error "10:no matching function for call to 'der" "" { target *-*-* } 9 }
......@@ -7,7 +7,7 @@ struct A {
void operator delete(void *);
};
struct B {
friend void A::foo() {} // { dg-error "22: error: cannot define member function 'A::foo' within 'B'" }
friend void A::operator delete(void*) {} // { dg-error "39: error: cannot define member function 'A::operator delete' within 'B'" }
friend A::A() {} // { dg-error "15: error: cannot define member function 'A::A' within 'B'" }
friend void A::foo() {} // { dg-error "22:cannot define member function 'A::foo' within 'B'" }
friend void A::operator delete(void*) {} // { dg-error "39:cannot define member function 'A::operator delete' within 'B'" }
friend A::A() {} // { dg-error "15:cannot define member function 'A::A' within 'B'" }
};
......@@ -5,5 +5,5 @@ static void InstantiateConstraint(const float&, unsigned,
void(*AddFunction)(const TYPE&,bool&,
char*, char*,
unsigned*));
// { dg-error "64: error: expected ',' or '...' before '&' token" "" { target *-*-* } { 5 } }
// { dg-error "60: error: ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 5 } }
// { dg-error "64:expected ',' or '...' before '&' token" "" { target *-*-* } { 5 } }
// { dg-error "60:ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 5 } }
......@@ -8,5 +8,5 @@ struct A
A(int);
};
A a = -A(); // { dg-error "10: error: no match for.*operator-.*in.*-A\\(\\)" }
A b = -A(5); // { dg-error "11: error: no match for.*operator-.*in.*-A\\(5\\)" }
A a = -A(); // { dg-error "10:no match for.*operator-.*in.*-A\\(\\)" }
A b = -A(5); // { dg-error "11:no match for.*operator-.*in.*-A\\(5\\)" }
......@@ -6,7 +6,7 @@ template<typename T> class foo{ };
int main() {
foo<int> i;
// this column number is not accurate yet, but that will make it for now.
foo<foo<int> j; // { dg-error "18: error: template argument 1 is invalid" }
foo<foo<int> j; // { dg-error "18:template argument 1 is invalid" }
int k;
int l;
foo<int> m;
......
......@@ -7,4 +7,4 @@ struct X {
int);
};
// { dg-error "4: error: 'itn' has not been declared" "" { target *-*-* } { 6 } }
// { dg-error "4:'itn' has not been declared" "" { target *-*-* } 6 }
......@@ -3,17 +3,17 @@
class Foo { int foo() return 0; } };
// { dg-error "30: error: expected identifier before numeric constant" "" { target *-*-* } { 4 } }
// { dg-error "30:expected identifier before numeric constant" "" { target *-*-* } 4 }
// { dg-error "23: error: named return values are no longer supported" "" { target *-*-* } { 4 } }
// { dg-error "23:named return values are no longer supported" "" { target *-*-* } 4 }
// the column number info of this error output is still wrong because the error
// message has been generated by cp_parser_error() which does not
// necessarily allow accurate column number display. At some point, we will
// need make cp_parser_error() report more accurate column numbers.
// { dg-error "30: error: expected '\{' at end of input" "" { target *-*-* } { 4 } }
// { dg-error "30:expected '\{' at end of input" "" { target *-*-* } 4 }
// { dg-error "35: error: expected unqualified-id before '\}' token" "" {target *-*-* } { 4 } }
// { dg-error "35:expected unqualified-id before '\}' token" "" {target *-*-* } 4 }
// { dg-error "35: error: expected declaration before '\}' token" "" {target *-*-* } { 4 } }
// { dg-error "35:expected declaration before '\}' token" "" {target *-*-* } 4 }
......@@ -5,7 +5,7 @@ int f(int not) {
return 1-not;
}
// { dg-error "11: error: expected ',' or '...' before '!' token" "" { target *-*-* } { 4 } }
// { dg-error "11:expected ',' or '...' before '!' token" "" { target *-*-* } 4 }
// { dg-error "15: error: expected primary\\-expression before ';' token" "" { target *-*-* } { 5 } }
// { dg-error "15:expected primary\\-expression before ';' token" "" { target *-*-* } 5 }
......@@ -4,4 +4,4 @@
void f(int x
int y);
// { dg-error "8: error: expected ',' or '...' before 'int'" "" { target *-*-* } { 5 } }
// { dg-error "8:expected ',' or '...' before 'int'" "" { target *-*-* } 5 }
......@@ -4,7 +4,7 @@
struct A { friend typename struct B; };
// { dg-error "19: error: using 'typename' outside of template" "" { target *-*-* } { 4 } }
// { dg-error "28: error: expected nested-name-specifier before 'struct'" "" { target *-*-* } { 4 } }
// { dg-error "35: error: multiple types in one declaration" "" { target *-*-* } { 4 } }
// { dg-error "12: error: friend declaration does not name a class or function" "" { target *-*-* } { 4 } }
// { dg-error "19:using 'typename' outside of template" "" { target *-*-* } 4 }
// { dg-error "28:expected nested-name-specifier before 'struct'" "" { target *-*-* } 4 }
// { dg-error "35:multiple types in one declaration" "" { target *-*-* } 4 }
// { dg-error "12:friend declaration does not name a class or function" "" { target *-*-* } 4 }
......@@ -5,5 +5,5 @@ enum { FOO = 1, BAR = 2 };
int a[] = { FOO: 1, BAR: 2 };
// the following 2 column locations are still not accurate enough
// { dg-error "28: error: name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } { 5 } }
// { dg-error "28: error: name 'BAR' 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" "" { target *-*-* } 5 }
// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 }
......@@ -3,5 +3,6 @@
extern "C" struct A
{
friend void foo(int) {} // { dg-error "declaration" }
friend void foo() {} // { dg-error "foo" }
friend void foo() {} // { dg-error "foo" "err" }
// { dg-warning "already a friend" "warn" { target *-*-* } 6 }
};
......@@ -6,8 +6,9 @@ template <int I> struct A
{
template <int> struct B
{
enum { e = I * A<I-1>::B }; // { dg-error "" }
enum { e = I * A<I-1>::B }; // { dg-error "dependent-name" "depname" }
// { dg-message "note" "note" { target *-*-* } 9 }
};
};
A<0>::B<0> a; // { dg-error "instantiated" }
A<0>::B<0> a; // { dg-message "instantiated" }
......@@ -12,7 +12,9 @@ template <typename T> struct A
template <typename T> void foo()
{
typedef typename A<T>::B<T>::X Y; // { dg-error "" }
typedef typename A<T>::B<T>::X Y; // { dg-error "non-template" "non" }
// { dg-error "not declare" "decl" { target *-*-* } 15 }
// { dg-message "note" "note" { target *-*-* } 15 }
}
void bar()
......
......@@ -8,14 +8,14 @@
template <class T>
struct Foo {
int j; // we never see this one.
int k; // { dg-error "" "" }
int k; // { dg-error "Foo" "" }
};
struct Baz
{
int j;
int k; // { dg-error "" "" }
int k; // { dg-error "candidates" "" }
};
......@@ -31,7 +31,7 @@ int main()
Bar<int> bar;
bar.baz ();
bar.foo (); // { dg-error "instantiated" "" }
bar.foo (); // { dg-message "instantiated" "" }
return 0;
}
struct S {} f(); // { dg-error "" }
struct T {} *g(); // { dg-error "" }
struct U {} h() {} // { dg-error "" }
struct V {} *i() {} // { dg-error "" }
struct W {} (*p) (); // { dg-error "" }
struct S {} f(); // { dg-error "return" "err" }
// { dg-message "note" "note" { target *-*-* } 1 }
struct T {} *g(); // { dg-error "return" }
// { dg-message "note" "note" { target *-*-* } 3 }
struct U {} h() {} // { dg-error "return" }
// { dg-message "note" "note" { target *-*-* } 5 }
struct V {} *i() {} // { dg-error "return" }
// { dg-message "note" "note" { target *-*-* } 7 }
struct W {} (*p) (); // { dg-error "return" }
// { dg-message "note" "note" { target *-*-* } 9 }
......@@ -3,4 +3,5 @@
// { dg-do compile }
template <typename T> class A;
template <typename T> class A<T>::B; // { dg-error "declaration" }
template <typename T> class A<T>::B; // { dg-error "declaration" "err" }
// { dg-warning "declaration" "warn" { target *-*-* } 6 }
......@@ -49,4 +49,4 @@ template<int I> void f2()
A::template B<I>::template b2<double>(0);
}
template void f2<0>(); // { dg-error "instantiated" }
template void f2<0>(); // { dg-message "instantiated" }
......@@ -13,5 +13,7 @@ struct X : Outer<b>::template Inner<T>
{};
template <bool b, typename T>
struct Y : Outer<b>::Inner<T> {}; // { dg-error "" "" }
struct Y : Outer<b>::Inner<T> {}; // { dg-error "used as template" "temp" }
// { dg-error "expected" "exp" { target *-*-* } 16 }
// { dg-message "note" "note" { target *-*-* } 16 }
template <typename T>
void f() {
g(); // { dg-error "" }
h(3); // { dg-error "" }
g(); // { dg-error "must be available" "err" }
// { dg-message "note" "note" { target *-*-* } 3 }
h(3); // { dg-error "must be available" }
}
......@@ -7,9 +7,7 @@ template <class T> struct S {
typedef int X;
};
struct I2 : public I1 {
X x; // { dg-error "does not name a type" }
X x; // { dg-error "does not name a type" "name" }
// { dg-message "note" "note" { target *-*-* } 10 }
};
};
// Additional notes on the same line are allowed
// { dg-error "" "additional" { target *-*-* } 10 }
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