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] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 31 Jul 2003 
5
 
6
// PR c++/11525 incorrect error about non-constant initalizer
7
 
8
template class X;
9
template class Y {};
10
 
11
 
12
template
13
void Foo ()
14
{
15
  static const unsigned I = X::I;
16
 
17
  Y i;
18
 
19
  static const unsigned J = X::J;
20
 
21
  Y j; // { dg-error "non-constant" "" }
22
}
23
 
24
struct A
25
{
26
  operator unsigned () const;
27
};
28
 
29
template  struct X
30
{
31
  enum {I};
32
  static A const J;
33
};
34
 
35
void Baz ()
36
{
37
  Foo (); // { dg-message "instantiated" "" }
38
}
39
 
40
 

powered by: WebSVN 2.1.0

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