From: Jason Merrill Date: Fri, 25 Feb 2011 06:23:00 +0000 (-0500) Subject: constant1.C: Specify C++98 mode. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f9f0ad880bdcdfd1e25238bfde204fb4ad0f8d5;p=gcc.git constant1.C: Specify C++98 mode. * g++.dg/parse/constant1.C: Specify C++98 mode. * g++.dg/parse/constant5.C: Likewise. * g++.dg/parse/error2.C: Likewise. * g++.dg/parse/semicolon3.C: Likewise. * g++.dg/template/crash14.C: Likewise. * g++.dg/template/local4.C: Likewise. * g++.dg/template/nontype3.C: Likewise. * g++.dg/parse/crash31.C: Adjust expected errors. * g++.dg/template/function1.C: Likewise. * g++.dg/template/ref3.C: Likewise. * g++.dg/template/static9.C: Likewise. * g++.old-deja/g++.pt/crash41.C: Instantiate template. From-SVN: r170489 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5acd9f25057..3d3d81275eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,18 @@ 2011-02-24 Jason Merrill + * g++.dg/parse/constant1.C: Specify C++98 mode. + * g++.dg/parse/constant5.C: Likewise. + * g++.dg/parse/error2.C: Likewise. + * g++.dg/parse/semicolon3.C: Likewise. + * g++.dg/template/crash14.C: Likewise. + * g++.dg/template/local4.C: Likewise. + * g++.dg/template/nontype3.C: Likewise. + * g++.dg/parse/crash31.C: Adjust expected errors. + * g++.dg/template/function1.C: Likewise. + * g++.dg/template/ref3.C: Likewise. + * g++.dg/template/static9.C: Likewise. + * g++.old-deja/g++.pt/crash41.C: Instantiate template. + * g++.dg/cpp0x/constexpr-array-tparm.C: New. * g++.dg/cpp0x/regress/parse-ambig5.C: Copy from parse/ambig5.C. * g++.dg/cpp0x/regress/debug-debug7.C: Copy from debug/debug7.C. diff --git a/gcc/testsuite/g++.dg/parse/constant1.C b/gcc/testsuite/g++.dg/parse/constant1.C index 0a889289b72..c8a948a5760 100644 --- a/gcc/testsuite/g++.dg/parse/constant1.C +++ b/gcc/testsuite/g++.dg/parse/constant1.C @@ -1,3 +1,5 @@ +// { dg-options -std=c++98 } + void f () { switch (0) { case (3, 0): // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/parse/constant5.C b/gcc/testsuite/g++.dg/parse/constant5.C index db11afb51b2..f868108a644 100644 --- a/gcc/testsuite/g++.dg/parse/constant5.C +++ b/gcc/testsuite/g++.dg/parse/constant5.C @@ -1,3 +1,5 @@ +// { dg-options "-std=c++98 -pedantic-errors" } + enum E { a = 24.2, // { dg-error "constant" } b = (int)3.7, diff --git a/gcc/testsuite/g++.dg/parse/crash31.C b/gcc/testsuite/g++.dg/parse/crash31.C index 0068846755b..b0a7e1877ce 100644 --- a/gcc/testsuite/g++.dg/parse/crash31.C +++ b/gcc/testsuite/g++.dg/parse/crash31.C @@ -3,7 +3,7 @@ struct A // { dg-error "forward declaration" } A : A; // { dg-error "expected|incomplete" } A : B; // { dg-error "not declared|incomplete" } A : A(); // { dg-error "undefined type|incomplete" } - A : B(); // { dg-error "function call|incomplete" } + A : B(); // { dg-error "function call|incomplete|not declared" } A : A[]; // { dg-error "expected|array reference|incomplete" } A : B[]; // { dg-error "not declared|expected|array reference|incomplete" } }; diff --git a/gcc/testsuite/g++.dg/parse/error2.C b/gcc/testsuite/g++.dg/parse/error2.C index 619f89421d9..7b08df45466 100644 --- a/gcc/testsuite/g++.dg/parse/error2.C +++ b/gcc/testsuite/g++.dg/parse/error2.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-fshow-column" } +// { dg-options "-fshow-column -std=c++98" } // Properly print CALL_EXPRs while dumping expressions double g; diff --git a/gcc/testsuite/g++.dg/parse/semicolon3.C b/gcc/testsuite/g++.dg/parse/semicolon3.C index bc43b48cff7..8a2b1ac4630 100644 --- a/gcc/testsuite/g++.dg/parse/semicolon3.C +++ b/gcc/testsuite/g++.dg/parse/semicolon3.C @@ -1,5 +1,6 @@ // PR c++/45331 // { dg-do compile } +// { dg-options -std=c++98 } struct OK1 { diff --git a/gcc/testsuite/g++.dg/template/crash14.C b/gcc/testsuite/g++.dg/template/crash14.C index 7b3af045fa9..cf6fffa1a6b 100644 --- a/gcc/testsuite/g++.dg/template/crash14.C +++ b/gcc/testsuite/g++.dg/template/crash14.C @@ -1,3 +1,5 @@ +// { dg-options -std=c++98 } + template class foo { public: foo() { } class Z { };}; template void dep7(foo *) { } // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/template/function1.C b/gcc/testsuite/g++.dg/template/function1.C index 3f82d5326f6..8a112c1459f 100644 --- a/gcc/testsuite/g++.dg/template/function1.C +++ b/gcc/testsuite/g++.dg/template/function1.C @@ -3,25 +3,25 @@ template struct A {}; const char func[] = "abc"; -template struct A {}; // { dg-error "cannot appear|is invalid|not a valid" } +template struct A {}; // { dg-error "cannot appear|is invalid|not a valid|not declared constexpr" } char a1[1]; A a; template struct B {}; -template struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" } +template struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" } char b1[1]; B b; template struct C {}; -template struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" } +template struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" } char c1[1]; C c; template struct D {}; -template struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope" } +template struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope|not declared constexpr" } char d1[1]; D d; diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C index 7ee922ba6d3..9a03c9a7b98 100644 --- a/gcc/testsuite/g++.dg/template/local4.C +++ b/gcc/testsuite/g++.dg/template/local4.C @@ -1,9 +1,10 @@ // PR c++/17413 +// { dg-options -std=c++98 } template void foo() {} // { dg-message "note" } int main () { struct S {}; foo (); // { dg-error "match" } - // { dg-message "candidate" "candidate note" { target *-*-* } 7 } + // { dg-message "candidate" "candidate note" { target *-*-* } 8 } } diff --git a/gcc/testsuite/g++.dg/template/nontype3.C b/gcc/testsuite/g++.dg/template/nontype3.C index 5f245620a83..d0c6b72a1d3 100644 --- a/gcc/testsuite/g++.dg/template/nontype3.C +++ b/gcc/testsuite/g++.dg/template/nontype3.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-options -std=c++98 } // Origin: , // // c++/13243: Template parameters of non integral or enumeration type can't be diff --git a/gcc/testsuite/g++.dg/template/ref3.C b/gcc/testsuite/g++.dg/template/ref3.C index 4390f71b407..976c093a15b 100644 --- a/gcc/testsuite/g++.dg/template/ref3.C +++ b/gcc/testsuite/g++.dg/template/ref3.C @@ -4,8 +4,8 @@ template struct A {}; template struct B { - A<(T)0> b; // { dg-error "constant" } - A a; // { dg-error "constant" } + A<(T)0> b; // { dg-error "constant|not a valid" } + A a; // { dg-error "constant|not a valid" } }; B b; diff --git a/gcc/testsuite/g++.dg/template/static9.C b/gcc/testsuite/g++.dg/template/static9.C index a98144185bb..8845647601b 100644 --- a/gcc/testsuite/g++.dg/template/static9.C +++ b/gcc/testsuite/g++.dg/template/static9.C @@ -3,7 +3,7 @@ template struct A { static const T i = 0; // { dg-error "declared void" "void" } - // { dg-error "invalid" "invalid" { target *-*-* } 5 } + // { dg-error "invalid|non-literal" "invalid" { target *-*-* } 5 } }; A a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash41.C b/gcc/testsuite/g++.old-deja/g++.pt/crash41.C index fc7f7b51497..452ba91dc84 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash41.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash41.C @@ -9,3 +9,5 @@ template void f(S2 s2) { S1 s1; // { dg-error "" } } + +template void f(S2);