summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr45310.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/pr45310.C')
-rw-r--r--gcc/testsuite/g++.dg/pr45310.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pr45310.C b/gcc/testsuite/g++.dg/pr45310.C
new file mode 100644
index 000000000..335c78257
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr45310.C
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fnon-call-exceptions" } */
+
+static inline const int &
+max (const int &a, const int &b)
+{
+ return a ? a : b;
+}
+
+static inline int
+baz ()
+{
+ return max (0, 0);
+}
+
+struct S
+{
+ ~S ()
+ {
+ baz ();
+ }
+};
+
+void bar ();
+void
+foo ()
+{
+ S s;
+ bar ();
+}
+