c++: check alias match for specializations [PR98116]
authorNathan Sidwell <nathan@acm.org>
Mon, 7 Dec 2020 15:02:58 +0000 (07:02 -0800)
committerNathan Sidwell <nathan@acm.org>
Mon, 7 Dec 2020 16:49:33 +0000 (08:49 -0800)
commit9d0eb0ae948f0fbee208cfb9a86133abea650f81
tree5d307f9a0ab43a547195ce1d7f76516e402cfefd
parent92e563d91b012f09da8fd152e934f6b964ae49cb
c++: check alias match for specializations [PR98116]

This fixes the underlying problem my recent (backedout) changes to
array type creation uncovered.  We had paths through
structural_comptypes that ignored alias templates, even when
significant.  This adds the necessary checks.

PR c++/98116
gcc/cp/
* typeck.c (structural_comptypes): Move early outs to comptype.
Always check template-alias match when comparing_specializations.
(comptypes): Do early out checking here.
gcc/testsuite/
* g++.dg/template/pr98116.C: Remove dg-ice.
* g++.dg/template/pr98116-2.C: New.
gcc/cp/typeck.c
gcc/testsuite/g++.dg/template/pr98116-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr98116.C