diff options
author | Jason Merrill <jason@redhat.com> | 2021-02-03 00:29:00 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-02-03 12:50:18 -0500 |
commit | 5c62e4f255bfac65e18213fd93ee1c9908b4a750 (patch) | |
tree | 2d5227e4e90c13b9f75c484e536da700115625d3 | |
parent | 5c3d388aee5609d32bd8e3ba1add776b1a6f0d1f (diff) | |
download | gcc-5c62e4f255bfac65e18213fd93ee1c9908b4a750.zip gcc-5c62e4f255bfac65e18213fd93ee1c9908b4a750.tar.gz gcc-5c62e4f255bfac65e18213fd93ee1c9908b4a750.tar.bz2 |
c++: Fix alias comparison [PR98926]
The comparison of dependent aliases wasn't working here because
processing_template_decl wasn't set, so dependent_alias_template_spec_p was
always returning false.
gcc/cp/ChangeLog:
PR c++/98926
PR c++/98570
* pt.c (spec_hasher::equal): Set processing_template_decl.
* Make-lang.in (check-g++-strict-gc): Add --param
hash-table-verification-limit=10000.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/alias-decl-dr1558.C: Pass --param
hash-table-verification-limit=10000.
-rw-r--r-- | gcc/cp/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 62295fb..155be74 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -224,7 +224,7 @@ check-c++-all: # Run the testsuite with garbage collection at every opportunity. check-g++-strict-gc: - $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0" \ + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0,--param,hash-table-verification-limit=10000" \ TESTSUITEDIR="$(TESTSUITEDIR).gc" check-g++ check-c++-subtargets : check-g++-subtargets # List of targets that can use the generic check- rule and its // variant. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4781519..c5b0a92 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1720,6 +1720,7 @@ spec_hasher::equal (spec_entry *e1, spec_entry *e2) ++comparing_specializations; ++comparing_dependent_aliases; + ++processing_template_decl; equal = (e1->tmpl == e2->tmpl && comp_template_args (e1->args, e2->args)); if (equal && flag_concepts @@ -1734,6 +1735,7 @@ spec_hasher::equal (spec_entry *e1, spec_entry *e2) tree c2 = e2->spec ? get_constraints (e2->spec) : NULL_TREE; equal = equivalent_constraints (c1, c2); } + --processing_template_decl; --comparing_dependent_aliases; --comparing_specializations; diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C index 2bbb138..8495462 100644 --- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C @@ -1,5 +1,6 @@ // DR 1558 still applies when using void_t as a template-argument. // { dg-do compile { target c++11 } } +// { dg-additional-options "--param hash-table-verification-limit=10000" } template<typename...> using void_t = void; template<class T> struct A { }; |