From: Jason Merrill Date: Thu, 5 Mar 2020 04:07:13 +0000 (-0500) Subject: c++: Fix constexpr ICE from const mismatch [PR91607] X-Git-Tag: releases/gcc-9.3.0~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e19f06538c51fed54240a4e98277e62daa00d9b3;p=thirdparty%2Fgcc.git c++: Fix constexpr ICE from const mismatch [PR91607] gcc/cp/ChangeLog 2020-03-04 Jason Merrill PR c++/91607 * constexpr.c (constexpr_call_hasher::equal): Use same_type_ignoring_top_level_qualifiers_p. --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f4c1b1f6a35..6c4a7751662a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-03-04 Jason Merrill + + PR c++/91607 + * constexpr.c (constexpr_call_hasher::equal): Use + same_type_ignoring_top_level_qualifiers_p. + 2020-03-04 Martin Sebor PR c++/90938 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index b9b387ca7e93..bab5935a4ebf 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1088,7 +1088,8 @@ constexpr_call_hasher::equal (constexpr_call *lhs, constexpr_call *rhs) { tree lhs_arg = TREE_VALUE (lhs_bindings); tree rhs_arg = TREE_VALUE (rhs_bindings); - gcc_assert (same_type_p (TREE_TYPE (lhs_arg), TREE_TYPE (rhs_arg))); + gcc_assert (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (lhs_arg), TREE_TYPE (rhs_arg))); if (!cp_tree_equal (lhs_arg, rhs_arg)) return false; lhs_bindings = TREE_CHAIN (lhs_bindings);