OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [parse/] [constant4.C] - Diff between revs 301 and 338

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" "" }
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.