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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [new1.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run }
2
// { dg-options "-O2" }
3
 
4
// Copyright (C) 2004 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 2 Dec 2004 
6
 
7
// PR 18318. ICE with template new[]
8
// Origin:Elliot Hughes 
9
// Andrew Pinski 
10
 
11
struct Aint
12
{
13
  ~Aint ();
14
  Aint ();
15
};
16
 
17
Aint::Aint () {}
18
Aint::~Aint () {}
19
 
20
static int count;
21
 
22
template 
23
struct A
24
{
25
  unsigned Blksize() const;
26
 
27
  void f()
28
  {
29
    new T[Blksize()];
30
  }
31
};
32
 
33
template  unsigned A::Blksize () const
34
{
35
  count++;
36
  return 1;
37
}
38
 
39
int main ()
40
{
41
  A a;
42
  a.f();
43
 
44
  return count != 1;
45
}

powered by: WebSVN 2.1.0

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