URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// { dg-do compile }
|
// { dg-do compile }
|
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 31 Jul 2003
|
// Contributed by Nathan Sidwell 31 Jul 2003
|
|
|
// PR c++/11525 incorrect error about non-constant initalizer
|
// PR c++/11525 incorrect error about non-constant initalizer
|
|
|
template class X;
|
template class X;
|
template class Y {};
|
template class Y {};
|
|
|
|
|
template
|
template
|
void Foo ()
|
void Foo ()
|
{
|
{
|
static const unsigned I = X::I;
|
static const unsigned I = X::I;
|
|
|
Y i;
|
Y i;
|
|
|
static const unsigned J = X::J;
|
static const unsigned J = X::J;
|
|
|
Y j; // { dg-error "non-constant" "" }
|
Y j; // { dg-error "non-constant" "" }
|
}
|
}
|
|
|
struct A
|
struct A
|
{
|
{
|
operator unsigned () const;
|
operator unsigned () const;
|
};
|
};
|
|
|
template struct X
|
template struct X
|
{
|
{
|
enum {I};
|
enum {I};
|
static A const J;
|
static A const J;
|
};
|
};
|
|
|
void Baz ()
|
void Baz ()
|
{
|
{
|
Foo (); // { dg-message "instantiated" "" }
|
Foo (); // { dg-message "instantiated" "" }
|
}
|
}
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.