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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [packed2.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/10091
2
 
3
// Original synopsis
4
// Bug: We were dying because in general, B::a doesn't have enough
5
// alignment for us to take its address.  But if the B is C::b, it does
6
// have enough alignment, and we should be able to determine that.
7
 
8
// This only failed on STRICT_ALIGNMENT targets (i.e. not i686)
9
 
10
// July 2003
11
// packing of non-pods is now only allowed if the non-pod is itself
12
// packed. Also only such pods can be reference bound to non-consts
13
 
14
struct A {
15
  int i;
16
 
17
  A();
18
  A(const A&);
19
  A& operator=(const A&);
20
} __attribute__ ((packed));
21
 
22
struct B {
23
  A a;
24
} __attribute__ ((packed));
25
 
26
struct C {
27
  B b;
28
  int j;
29
};
30
 
31
void f (A&);
32
void g (C& c)
33
{
34
  f (c.b.a);
35
}

powered by: WebSVN 2.1.0

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