From 4326a074cb25bc92685b22c6e432a40f4610ef37 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 22 Nov 2012 14:42:00 +0000 Subject: PR c++/55137 * semantics.c (verify_constant): Track overflow separately. (reduced_constant_expression_p): Don't check it here. (cxx_eval_constant_expression): Check it on CSTs. (cxx_eval_outermost_constant_expr): Treat overflows as non-constant at this point, but still return the folded version. (potential_constant_expression_1): Don't check overflow. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193727 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/init/static-init3.C | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 gcc/testsuite/g++.dg/init/static-init3.C (limited to 'gcc/testsuite/g++.dg/init') diff --git a/gcc/testsuite/g++.dg/init/static-init3.C b/gcc/testsuite/g++.dg/init/static-init3.C new file mode 100644 index 00000000000..9f89c3119b3 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/static-init3.C @@ -0,0 +1,9 @@ +// PR c++/55137 +// s should have constant initialization. +// { dg-final { scan-assembler-not "GLOBAL" } } + +struct S { + int b; +}; + +struct S s = { -1 + (int)(sizeof(int) - 1) }; -- cgit v1.2.1