summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/packed9.C
blob: ba5d4ab044f7f79077e5812d97f1f27f8c4795e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 26 Apr 2005 <nathan@codesourcery.com>

// DR21166. unnecessary error on packed char

struct s1 {
        char    c1;
} __attribute__((packed));

char&
f(struct s1 *s)
{
        return s->c1;
}

char *
g(struct s1 *s)
{
        return &s->c1;
}