* 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
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.
+// { dg-options -std=c++98 }
+
void f () {
switch (0) {
case (3, 0): // { dg-error "" }
+// { dg-options "-std=c++98 -pedantic-errors" }
+
enum E {
a = 24.2, // { dg-error "constant" }
b = (int)3.7,
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" }
};
// { dg-do compile }
-// { dg-options "-fshow-column" }
+// { dg-options "-fshow-column -std=c++98" }
// Properly print CALL_EXPRs while dumping expressions
double g;
// PR c++/45331
// { dg-do compile }
+// { dg-options -std=c++98 }
struct OK1
{
+// { 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 "" }
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;
// 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 }
}
// { 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
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;
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" }
void f(S2 s2) {
S1<s2.i> s1; // { dg-error "" }
}
+
+template void f<int>(S2);