aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/pr83556.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/pr83556.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr83556.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr83556.C b/gcc/testsuite/g++.dg/cpp0x/pr83556.C
new file mode 100644
index 00000000000..bab06a5b943
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr83556.C
@@ -0,0 +1,28 @@
+// PR c++/83556
+// { dg-do run { target c++11 } }
+
+int
+foo ()
+{
+ return 1;
+}
+
+struct A
+{
+ int a = foo ();
+ int b = 1;
+ int c = a ? 1 * b : 2 * b;
+};
+
+struct B
+{
+ A d {};
+};
+
+int
+main ()
+{
+ B e {};
+ if (e.d.c != 1)
+ __builtin_abort ();
+}