c++: tweak C++20 destructor template-id rule
authorJason Merrill <jason@redhat.com>
Mon, 13 Sep 2021 20:45:42 +0000 (16:45 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 15 Sep 2021 04:05:33 +0000 (00:05 -0400)
commitf53a89fe722958d29fded71b444ff0f09b57b2c4
tree3c6d701c78b6be00ddfbcc9694a04cf93ad6288e
parent4633d623d7c112a8e239b84b2d85caaef02d316c
c++: tweak C++20 destructor template-id rule

While working on a larger change to destructor lookup I noticed that this
rule talks about declarators, but we weren't limiting the error to the case
where we're parsing a declarator.  I don't know if this actually broke
anything, since a CPP_TEMPLATE_ID would have to have been parsed once
before, but it's more correct this way.

gcc/cp/ChangeLog:

* parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
a declarator.
gcc/cp/parser.c