summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr42357.C
blob: 1a1d64e4f8e9fb4cffd158de1a9428a2f237ead3 (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
// { dg-do compile }
typedef unsigned char uint8;
typedef unsigned int uint32;
class PixelARGB {
public:
    ~PixelARGB() throw() { }
    PixelARGB (const uint32 argb_) throw() : argb (argb_)     { }
    inline __attribute__((always_inline)) uint8 getRed() const throw() {
	return components.r;
    }
    union     {
	uint32 argb;
	struct         {
	    uint8 b, g, r, a;
	} components;
    };
};
class Colour {
public:
    Colour() throw() : argb (0) {};
    uint8 getRed() const throw() {
	return argb.getRed();
    }
    PixelARGB argb;
};
uint8 writeImage (void) {
    Colour pixel;
    pixel = Colour ();
    return pixel.getRed();
}