Commit ef8f74d6 by Andrew Pinski

re PR c++/11507 (parser fails to recognize namespace)

2003-09-06  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/11507
        * g++.dg/lookup/scoped7.C: New test.

        PR c++/9574
        * g++.dg/other/static1.C: New test.

        PR c++/11490
        * g++.dg/warn/template-1.C: New test.

        PR c++/11432
        * g++.dg/template/crash10.C: New test.

        PR c++/2478
        * g++.dg/overload/VLA.C: New test.

        PR c++/10804
        * g++.dg/template/call1.C: New test.

From-SVN: r71156
parent 9aec989f
//PR c++/11507
// Origin: kai-gcc-bugs@khms.westfalen.de and bangerth@dealii.org
//The new parser used to fail on this.
// { dg-do compile }
namespace NS
{
void foo(bool arg1);
}
namespace M {
namespace K {
bool Bc(bool x);
}
void bar() {
NS::foo (K::Bc(true)); // GCC could not find K or Bc.
}
}
// PR c++/9574
// Origin: fche@redhat.com and bangerth@dealii.org
// The new parser ICE on this test and then it could
// not find z in bar::bar().
// { dg-do compile }
struct X {
void operator[](const int& __k);
};
struct foo {
static X x;
};
struct bar {
int z;
bar () { foo::x[z]; };
};
//Origin: kengole@us.ibm.com
//PR c++/2478
// G++ was rejecting this as it could not convert `int (*)[]' to `int (*)[0]'.
// Using the C99 VLA style arrays in a struct.
// { dg-do compile }
struct {
int (*p)[];
} B;
void foo() {
int (*p)[];
B.p=p; // { dg-bogus "cannot convert" }
}
//Origin: harinath@cs.umn.edu
//PR c++/10804
// G++ was not emiting the function foo.
// { dg-do run }
template<class T>
struct A
{
A() { const void (*a)() = foo; }
static const void foo() {}
};
int main(int argc, char *argv[])
{
A<int> a;
}
//Origin: benko@sztaki.hu
//PR c++/11432
// The mainline ICE on this one between 2003-01-16 and 2003-07-29.
// { dg-do run }
extern "C" void abort();
template <int A>
struct a
{
static int const value = A - 1;
};
template <int B>
struct b
{
static int foo()
{
return a<L>::value;
}
static int const L = a<B + 1>::value;
};
//Origin: bangerth@dealii.org
//PR c++/11490
//Since N is know at instantiation time, there
// should be no warning about comparision between
// unsinged and signed interegers.
// { dg-do compile }
// { dg-options "-W" }
template <int N> bool f() {
unsigned int i=0;
return i!=N; // { dg-bogus "signed and unsigned" }
}
template bool f<2> ();
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