annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2 typedef unsigned char uint8;
kono
parents:
diff changeset
3 typedef unsigned int uint32;
kono
parents:
diff changeset
4 class PixelARGB {
kono
parents:
diff changeset
5 public:
kono
parents:
diff changeset
6 ~PixelARGB() throw() { }
kono
parents:
diff changeset
7 PixelARGB (const uint32 argb_) throw() : argb (argb_) { }
kono
parents:
diff changeset
8 inline __attribute__((always_inline)) uint8 getRed() const throw() {
kono
parents:
diff changeset
9 return components.r;
kono
parents:
diff changeset
10 }
kono
parents:
diff changeset
11 union {
kono
parents:
diff changeset
12 uint32 argb;
kono
parents:
diff changeset
13 struct {
kono
parents:
diff changeset
14 uint8 b, g, r, a;
kono
parents:
diff changeset
15 } components;
kono
parents:
diff changeset
16 };
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18 class Colour {
kono
parents:
diff changeset
19 public:
kono
parents:
diff changeset
20 Colour() throw() : argb (0) {};
kono
parents:
diff changeset
21 uint8 getRed() const throw() {
kono
parents:
diff changeset
22 return argb.getRed();
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24 PixelARGB argb;
kono
parents:
diff changeset
25 };
kono
parents:
diff changeset
26 uint8 writeImage (void) {
kono
parents:
diff changeset
27 Colour pixel;
kono
parents:
diff changeset
28 pixel = Colour ();
kono
parents:
diff changeset
29 return pixel.getRed();
kono
parents:
diff changeset
30 }