https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90825
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Wed Jun 12 22:26:54 2019 New Revision: 272221 URL: https://gcc.gnu.org/viewcvs?rev=272221&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-sizeof2.C trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-sizeof3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog