Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/opt/static5.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/31809 |
2 // { dg-do run } | |
3 // { dg-options "-O2" } | |
4 | |
5 struct S | |
6 { | |
7 unsigned v; | |
8 static inline S f (unsigned a); | |
9 }; | |
10 | |
11 inline S | |
12 S::f (unsigned a) | |
13 { | |
14 static S t = { a }; | |
15 return t; | |
16 } | |
17 | |
18 const static S s = S::f (26); | |
19 | |
20 extern "C" void abort (void); | |
21 | |
22 int | |
23 main () | |
24 { | |
25 S t = s; | |
26 if (t.v != 26) | |
27 abort (); | |
28 return 0; | |
29 } |