gengtype.c (write_field_root): Avoid out-of-scope access of newv.
[gcc.git] / gcc / testsuite / g++.dg / pr45310.C
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fnon-call-exceptions" } */
3
4 static inline const int &
5 max (const int &a, const int &b)
6 {
7 return a ? a : b;
8 }
9
10 static inline int
11 baz ()
12 {
13 return max (0, 0);
14 }
15
16 struct S
17 {
18 ~S ()
19 {
20 baz ();
21 }
22 };
23
24 void bar ();
25 void
26 foo ()
27 {
28 S s;
29 bar ();
30 }
31