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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [eh5.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR 41377
2
// { dg-do compile }
3
// { dg-options "-O3" }
4
 
5
struct A
6
{
7
  bool foo(int*) const;
8
} a;
9
 
10
struct B {};
11
 
12
struct B1 : B
13
{
14
  bool (A::*pmf)(int*) const;
15
  const A* pa;
16
 
17
  B1() : pmf(&A::foo), pa(&a) {}
18
  bool operator()() const { return (pa->*pmf)(new int); }
19
};
20
 
21
struct B2 : B
22
{
23
  B1 b1;
24
 
25
  B2(const B1& _b1) : b1(_b1) {}
26
  bool operator()() const { return b1(); }
27
};
28
 
29
template struct C
30
{
31
  void bar(B2 b2) { while (b2()) ; }
32
  C() { bar(B2(B1())); }
33
};
34
 
35
void baz(int i)
36
{
37
  switch(i)
38
  {
39
    case 0: new C<0>;
40
    case 1: new C<1>;
41
    case 2: new C<2>;
42
  }
43
}

powered by: WebSVN 2.1.0

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