summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/attr1.C
blob: 10d6f57d3a7c7c158fc803071813d4b08aa75e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Test whether attributes are accepted both immediately after
// struct/union keyword and after the closing brace.
// { dg-do compile }

struct foo
{
  union __attribute__ ((packed))
  {
    int a;
    long b;
  };
  union __attribute__ ((packed)) __attribute__ ((unused))
  {
    int c;
    long d;
  };
};

union __attribute__ ((packed)) bar
{
  int c;
  long d;
};

struct __attribute__ ((packed)) baz
{
  int e;
  long f;
};

struct foo2
{
  union
  {
    int a;
    long b;
  } __attribute__ ((packed));
};

union bar2
{
  int c;
  long d;
} __attribute__ ((packed));

struct baz2
{
  int e;
  long f;
} __attribute__ ((packed));