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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 15 Jul 2003 
5
 
6
// Packed fields are unsuitable for direct reference binding.
7
 
8
struct Unpacked { int i; };
9
 
10
void Ref (int &p);
11
void Ref (Unpacked &p);
12
 
13
struct  __attribute__ ((packed)) Packed
14
{
15
  char c;
16
  int i;
17
  Unpacked u;
18
};
19
 
20
void Foo (Packed &p)
21
{
22
  Ref (p.i); // { dg-error "cannot bind packed field" "" { target { ! default_packed } } }
23
  Ref (p.u.i); // { dg-error "cannot bind packed field" "" { target { ! default_packed } } }
24
  Ref (p.u); // { dg-error "cannot bind packed field" "" { target { ! default_packed } } }
25
}

powered by: WebSVN 2.1.0

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