diff options
author | Jason Merrill <jason@redhat.com> | 2020-03-04 23:07:13 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-03-05 00:09:41 -0500 |
commit | e19f06538c51fed54240a4e98277e62daa00d9b3 (patch) | |
tree | cf5a9442dd128d388e5cd20a2b59e30495e7658e | |
parent | 1665d97d37559ea7403d5b3e0efd5c5ae416e1ae (diff) | |
download | gcc-e19f06538c51fed54240a4e98277e62daa00d9b3.zip gcc-e19f06538c51fed54240a4e98277e62daa00d9b3.tar.gz gcc-e19f06538c51fed54240a4e98277e62daa00d9b3.tar.bz2 |
c++: Fix constexpr ICE from const mismatch [PR91607]
gcc/cp/ChangeLog
2020-03-04 Jason Merrill <jason@redhat.com>
PR c++/91607
* constexpr.c (constexpr_call_hasher::equal): Use
same_type_ignoring_top_level_qualifiers_p.
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f4c1b1..6c4a775 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-03-04 Jason Merrill <jason@redhat.com> + + PR c++/91607 + * constexpr.c (constexpr_call_hasher::equal): Use + same_type_ignoring_top_level_qualifiers_p. + 2020-03-04 Martin Sebor <msebor@redhat.com> PR c++/90938 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index b9b387c..bab5935 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); |