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
This commit is contained in:
parent
4be5e5b12d
commit
8f9f0ad880
13 changed files with 34 additions and 10 deletions
|
@ -1,5 +1,18 @@
|
|||
2011-02-24 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// { dg-options -std=c++98 }
|
||||
|
||||
void f () {
|
||||
switch (0) {
|
||||
case (3, 0): // { dg-error "" }
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// { dg-options "-std=c++98 -pedantic-errors" }
|
||||
|
||||
enum E {
|
||||
a = 24.2, // { dg-error "constant" }
|
||||
b = (int)3.7,
|
||||
|
|
|
@ -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" }
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// PR c++/45331
|
||||
// { dg-do compile }
|
||||
// { dg-options -std=c++98 }
|
||||
|
||||
struct OK1
|
||||
{
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// { dg-options -std=c++98 }
|
||||
|
||||
template <int T> class foo { public: foo() { } class Z { };};
|
||||
template <int I[2]> void dep7(foo<I[0]> *) { } // { dg-error "" }
|
||||
|
||||
|
|
|
@ -3,25 +3,25 @@
|
|||
|
||||
template<const char *, int> struct A {};
|
||||
const char func[] = "abc";
|
||||
template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid" }
|
||||
template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|not declared constexpr" }
|
||||
|
||||
char a1[1];
|
||||
A<a1, 0> a;
|
||||
|
||||
template<const char *, int> struct B {};
|
||||
template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" }
|
||||
template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
|
||||
|
||||
char b1[1];
|
||||
B<b1, 0> b;
|
||||
|
||||
template<const char *, int> struct C {};
|
||||
template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" }
|
||||
template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
|
||||
|
||||
char c1[1];
|
||||
C<c1, 0> c;
|
||||
|
||||
template<const char *, int> struct D {};
|
||||
template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope" }
|
||||
template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope|not declared constexpr" }
|
||||
|
||||
char d1[1];
|
||||
D<d1, 0> d;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// PR c++/17413
|
||||
// { dg-options -std=c++98 }
|
||||
|
||||
template <typename T> void foo() {} // { dg-message "note" }
|
||||
|
||||
int main () {
|
||||
struct S {};
|
||||
foo<S> (); // { dg-error "match" }
|
||||
// { dg-message "candidate" "candidate note" { target *-*-* } 7 }
|
||||
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// { dg-do compile }
|
||||
// { dg-options -std=c++98 }
|
||||
// Origin: <drow at gcc dot gnu dot org>,
|
||||
// <giovannibajo at gcc dot gnu dot org>
|
||||
// c++/13243: Template parameters of non integral or enumeration type can't be
|
||||
|
|
|
@ -4,8 +4,8 @@ template<const int&> struct A {};
|
|||
|
||||
template<typename T> struct B
|
||||
{
|
||||
A<(T)0> b; // { dg-error "constant" }
|
||||
A<T(0)> a; // { dg-error "constant" }
|
||||
A<(T)0> b; // { dg-error "constant|not a valid" }
|
||||
A<T(0)> a; // { dg-error "constant|not a valid" }
|
||||
};
|
||||
|
||||
B<const int&> b;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
template<typename T> 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<void> a; // { dg-message "instantiated" }
|
||||
|
|
|
@ -9,3 +9,5 @@ template <class T>
|
|||
void f(S2 s2) {
|
||||
S1<s2.i> s1; // { dg-error "" }
|
||||
}
|
||||
|
||||
template void f<int>(S2);
|
||||
|
|
Loading…
Add table
Reference in a new issue