view gcc/testsuite/g++.dg/torture/pr42357.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { 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();
}