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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [overload/] [addr1.C] - Blame information for rev 701

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 6 Sep 2003 
5
// Origin: Volker Reichelt 
6
 
7
// PR c++/11788 we failed to instantiate a decl, and we lost some side
8
// effects
9
 
10
static int flag = 0;
11
 
12
template  struct A
13
{
14
  A &active ()  { flag++;}
15
 
16
  static void foo() {}
17
 
18
  static void bar () {}
19
  static void bar (int) {}
20
 
21
  int m;
22
};
23
 
24
void (*baz ()) ()
25
{
26
    A a;
27
    return &a.active ().foo;
28
}
29
 
30
void (*boz ()) ()
31
{
32
    A a;
33
    return &a.active ().bar;
34
}
35
 
36
int *buz ()
37
{
38
  A a;
39
 
40
  return &a.active ().m;
41
}
42
 
43
int main ()
44
{
45
  baz ();
46
  boz ();
47
  buz ();
48
 
49
  return flag != 3;
50
}

powered by: WebSVN 2.1.0

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