mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/3004 (Accepts illegal code)
PR c++/3004 * g++.dg/parse/typedef3.C: New test. PR c++/7906 * g++.dg/parse/operator2.C: New test. PR c++/8895 * g++.dg/parse/def-tmpl-arg1.C: New test. PR c++/9282 * g++.dg/parse/funptr1.C: New test. PR c++/9452 * g++.dg/parse/ambig3.C: New test. PR c++/9454 * g++.dg/parse/operator3.C: New test. PR c++/9486 * g++.dg/parse/template10.C: New test. PR c++/9488 * g++.dg/parse/template11.C: New test. PR c++/10150 * g++.dg/parse/invalid-op1.C: New test. PR c++/10247 * g++.dg/parse/condexpr1.C: New test. From-SVN: r69670
This commit is contained in:
parent
e0d1297c43
commit
4bd5635487
|
|
@ -1,3 +1,35 @@
|
|||
2003-07-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c++/3004
|
||||
* g++.dg/parse/typedef3.C: New test.
|
||||
|
||||
PR c++/7906
|
||||
* g++.dg/parse/operator2.C: New test.
|
||||
|
||||
PR c++/8895
|
||||
* g++.dg/parse/def-tmpl-arg1.C: New test.
|
||||
|
||||
PR c++/9282
|
||||
* g++.dg/parse/funptr1.C: New test.
|
||||
|
||||
PR c++/9452
|
||||
* g++.dg/parse/ambig3.C: New test.
|
||||
|
||||
PR c++/9454
|
||||
* g++.dg/parse/operator3.C: New test.
|
||||
|
||||
PR c++/9486
|
||||
* g++.dg/parse/template10.C: New test.
|
||||
|
||||
PR c++/9488
|
||||
* g++.dg/parse/template11.C: New test.
|
||||
|
||||
PR c++/10150
|
||||
* g++.dg/parse/invalid-op1.C: New test.
|
||||
|
||||
PR c++/10247
|
||||
* g++.dg/parse/condexpr1.C: New test.
|
||||
|
||||
2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* g++.dg/ext/packed3.C: New test.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
// PR c++/9452
|
||||
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
|
||||
// { dg-do compile }
|
||||
|
||||
template <int> struct A { static const int i = 1; };
|
||||
template <int> struct B {};
|
||||
|
||||
template <typename> void foo(B<0>) {} // { dg-error "" }
|
||||
|
||||
template <typename, int j> B<A<j>::i-1> foo(B<j>) { return B<0>(); } // { dg-error "" }
|
||||
|
||||
void bar() { foo<int>(B<0>()); } // { dg-error "ambiguous" }
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// PR c++/10247
|
||||
// Origin: Lars Gullik Bjønes <larsbj@lyx.org>
|
||||
// { dg-do compile }
|
||||
|
||||
struct A {};
|
||||
|
||||
A const foo();
|
||||
|
||||
void bar()
|
||||
{
|
||||
A a = foo();
|
||||
A b = true ? a : foo();
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// PR c++/8895
|
||||
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
|
||||
// { dg-do compile }
|
||||
|
||||
template <typename X, typename Y = B<X> > struct A // { dg-error "" }
|
||||
{
|
||||
A();
|
||||
A(const A&);
|
||||
}; // { dg-error "" }
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// PR c++/9282
|
||||
// Origin: Thomas Richter <thor@math.tu-berlin.de>
|
||||
// { dg-do compile }
|
||||
|
||||
typedef void (*fptr)();
|
||||
|
||||
struct A
|
||||
{
|
||||
template<int> static void foo() {}
|
||||
template<fptr f> static void bar() { (*f)(); }
|
||||
};
|
||||
|
||||
fptr f = A::bar< A::foo<0> >;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// PR c++/10150
|
||||
// Origin: Tom Evans <te200@eng.cam.ac.uk>
|
||||
// { dg-do compile }
|
||||
|
||||
template <int I> struct A
|
||||
{
|
||||
template <int> struct B
|
||||
{
|
||||
enum { e = I * A<I-1>::B }; // { dg-error "" }
|
||||
};
|
||||
};
|
||||
|
||||
A<0>::B<0> a; // { dg-error "instantiated" }
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// PR c++/7906
|
||||
// Origin: Marcel Loose <loose@astron.nl>
|
||||
// { dg-do compile }
|
||||
|
||||
template <typename> struct A { typedef int X; };
|
||||
|
||||
template <typename T> struct B
|
||||
{
|
||||
typedef A<T> Y;
|
||||
struct C { operator typename Y::X() const; };
|
||||
};
|
||||
|
||||
template <typename T> B<T>::C::operator typename B<T>::Y::X() const { return 0; }
|
||||
|
||||
B<int> b;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
// PR c++/9454
|
||||
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
|
||||
// { dg-do compile }
|
||||
|
||||
template <int> struct A
|
||||
{
|
||||
struct B { operator int (); };
|
||||
struct C : B { operator int (); };
|
||||
};
|
||||
|
||||
A<0> a;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// PR c++/9486
|
||||
// Origin: John Levon <levon@movementarian.org>
|
||||
// { dg-do compile }
|
||||
|
||||
template <typename> struct A
|
||||
{
|
||||
template <typename T> void foo(T);
|
||||
};
|
||||
|
||||
template <typename T> void bar()
|
||||
{
|
||||
A<void>().template foo<T>(0);
|
||||
}
|
||||
|
||||
template void bar<int>();
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// PR c++/9488
|
||||
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
|
||||
// { dg-do compile }
|
||||
|
||||
struct A
|
||||
{
|
||||
template <typename> void foo() {}
|
||||
};
|
||||
|
||||
template <typename T> struct B
|
||||
{
|
||||
void bar() { A().foo<T>(); }
|
||||
};
|
||||
|
||||
template struct B<int>;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
// PR c++/3004
|
||||
// Origin: Travis J.I. Corcoran <tjic@permabit.com>
|
||||
// { dg-do compile }
|
||||
|
||||
struct A { typedef A* Ptr; };
|
||||
|
||||
struct A::Ptr; // { dg-error "" }
|
||||
Loading…
Reference in New Issue