diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-22 14:42:00 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-22 14:42:00 +0000 |
commit | 4326a074cb25bc92685b22c6e432a40f4610ef37 (patch) | |
tree | 9c24e24f889471d133a7807f725c04c202a351bc /gcc/testsuite/g++.dg/init | |
parent | 6eeebe5ce3ac68a1b5d21afb2400b5ccb044c634 (diff) | |
download | gcc-4326a074cb25bc92685b22c6e432a40f4610ef37.tar.gz |
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
Diffstat (limited to 'gcc/testsuite/g++.dg/init')
-rw-r--r-- | gcc/testsuite/g++.dg/init/static-init3.C | 9 |
1 files changed, 9 insertions, 0 deletions
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) }; |