c++: Simplify typedef access checking
authorNathan Sidwell <nathan@acm.org>
Wed, 13 May 2020 20:17:25 +0000 (13:17 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 13 May 2020 20:17:25 +0000 (13:17 -0700)
commit2bb30de62f59caa9af1ec01aa1029795f4748842
tree8c1e10dc8086a99eea0a7a8f0b1cfcd4f7f08bce
parent833c7b4b5ef071bc3c5c79108baff55f2bcaaac3
c++: Simplify typedef access checking

I discovered that the template typedef access check was rather more
expensive than needed.  The call of get_types_needed_access_check in
the FOR_EACH_VEC_SAFE_ELT is the moral equivalent of 'for (size_t pos
= 0; pos != strlen (string); pos++)'.  Let's not do that.

* pt.c (perform_typedefs_access_check): Cache expensively
calculated object references.
(check_auto_in_tmpl_args): Just assert we do not get unexpected
nodes, rather than silently do nothing.
(append_type_to_template_for_access): Likewise, cache expensie
object reference.
gcc/cp/ChangeLog
gcc/cp/pt.c