OSDN Git Service

PR c/14649
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jun 2004 18:49:36 +0000 (18:49 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jun 2004 18:49:36 +0000 (18:49 +0000)
commit16cb78b33539f59d7912a7b9a1fd33c27d3d3c50
tree15790a9a0fa2a93d8ffe3c058372c43f8aef3c20
parente1c1d65f9e6aec41933fc341df6bcbd797dbf7e7
PR c/14649
* c-typeck.c (require_constant_value, require_constant_elements):
Move declarations to the top of the file.
(build_function_call): If we require a constant value, fold with
fold_initializer.  If the result is a constant, and the function
wasn't called using __builtin_foo, issue a pedantic warning.
(build_unary_op): If we require a constant value, fold tree with
fold_initializer.
(build_binary_op): Use require_constant_value to determine whether
to call fold or fold_initializer.

* gcc.dg/pr14649-1.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82705 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr14649-1.c [new file with mode: 0644]