public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] [PR94044] Fix ICE with sizeof<argumentpack>
@ 2020-03-23 14:42 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-03-23 14:42 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:26b3e568a60e9fd851efb436531752a5e49e6419
commit 26b3e568a60e9fd851efb436531752a5e49e6419
Author: Nathan Sidwell <nathan@acm.org>
Date: Mon Mar 23 03:39:49 2020 -0700
[PR94044] Fix ICE with sizeof<argumentpack>
Thanks to Jim for figuring out how to reproduce the problem, I was
able to apply pr94044-jig.diff to poorly hash the specialization
table. (That places all the specializations of a particular template
in the same bucket, forcing us to compare the arguments.)
The testcase creates sizeof_exprs containing argument packs, and we
can no longer use same_type_p on those.
PR c++/94044
* tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
operand.
Diff:
---
gcc/cp/ChangeLog | 6 ++++++
gcc/cp/tree.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0038704dad0..3340f47d506 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-23 nathans <nathan@acm.org>
+
+ PR c++/94044
+ * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
+ operand.
+
2020-03-21 Patrick Palka <ppalka@redhat.com>
PR c++/94066
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index da2e7fdcca3..b85967e1bfa 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3802,9 +3802,13 @@ cp_tree_equal (tree t1, tree t2)
if (SIZEOF_EXPR_TYPE_P (t2))
o2 = TREE_TYPE (o2);
}
+
if (TREE_CODE (o1) != TREE_CODE (o2))
return false;
- if (TYPE_P (o1))
+
+ if (ARGUMENT_PACK_P (o1))
+ return template_args_equal (o1, o2);
+ else if (TYPE_P (o1))
return same_type_p (o1, o2);
else
return cp_tree_equal (o1, o2);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-23 14:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 14:42 [gcc/devel/c++-modules] [PR94044] Fix ICE with sizeof<argumentpack> Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).