Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
S<0, 1, 2> > > >with S. If we kept the already deduced knowledge, we > > >would reject the possibility I=1. */ > > > - copy_of_targs = make_tree_vec (TREE_VEC_LENGTH (targs)); > > > + targs = copy_template_args (targs); > > > +

Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Jason Merrill via Gcc-patches
targs (bootstrap and regtest in progress): -- >8 -- Subject: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros After r13-332-g88459c3965e2a2, it looks like we can safely remove the NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which should make its uses easier to reason about. b

Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
mplate arguments, so it might be better to use copy_node manually instead of copy_template_args. But this redundant copying shouldn't matter much if we make sure to ggc_free it afterwards. So here's v2 which additionally makes try_class_unification ggc_free this copy of targs (bootst

[PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
After r13-332-g88459c3965e2a2, it looks like we can safely remove the NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which simplifies its semantics. And TMPL_ARGS_LEVEL should verify the level argument is sane in the one-dimensional vector case. This change uncovered a couple of latent bugs: in t