]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/90825 - endless recursion when evaluating sizeof.
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jun 2019 22:26:54 +0000 (22:26 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jun 2019 22:26:54 +0000 (22:26 +0000)
commit518af62d9ff9ffffb83709dcfa895074b8fd2234
tree146e85e9437b5e7a54bf249206e7a6554193ee14
parent3c58902657c6ffd5ae69c5309019ed38d2ee1edd
PR c++/90825 - endless recursion when evaluating sizeof.
PR c++/90832 - endless recursion when evaluating sizeof.
* constexpr.c (cxx_eval_constant_expression): Don't recurse on the
result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
* typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
is instantiation-dependent.

* g++.dg/cpp0x/constexpr-sizeof2.C: New test.
* g++.dg/cpp0x/constexpr-sizeof3.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272221 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-sizeof2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-sizeof3.C [new file with mode: 0644]