PR c++/90825 - endless recursion when evaluating sizeof.
commit99e764a225b18deb086ee0e73a14c92df52bed5d
authorMarek Polacek <polacek@redhat.com>
Wed, 12 Jun 2019 22:26:54 +0000 (12 22:26 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 12 Jun 2019 22:26:54 +0000 (12 22:26 +0000)
tree146e85e9437b5e7a54bf249206e7a6554193ee14
parentd52a6e0a86203c42a9a1fc0e4f900d3f712002c1
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.

From-SVN: r272221
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]