On 07/24/2012 08:06 PM, Jason Merrill wrote:
On 07/24/2012 10:23 AM, Paolo Carlini wrote:
while looking into the re-opened c++/51213 (doesn't seem trivial:
details soon, I hope) I noticed things which look like old pastos: in
convert_template_argument and tsubst we are computing complain &
tf_error for the - tsubst_flags_t, not bool - fourth argument of
make_typename_type. That doesn't make much sense to me and the below,
as-is, passes testing.
The point of this use of (complain & tf_error) is to mask out flags we
don't want and leave only tf_error. It may or may not be needed, but
it's not a pasto.
Ok, thanks. Probably loooked to me like a pasto because we are using
this kind of clearing in very few places, if at all (if I'm not mistaken).
Anyway, in the meanwhile I had a closer look and I think isn't really
needed because:
1- make_typename_type and the functions it calls (like
perform_or_defer_access_check) only pay attention to tf_error (only
make_typename_type itself to tf_keep_type_decl).
2- make_typename_type checks indeed tf_keep_type_decl but calling it
with complain & tf_error (as convert_template_argument does) vs plain
complain cannot make a difference, because tf_keep_type_decl cannot be
"randomly" set in complain, because in the whole front-end we set
tf_keep_type_decl *only* in the flags we pass to make_typename_type
itself from tsubst.
Thus, all in all, I propose doing the change anyway, of course with a
different ChangeLog: if what I summarized above is correct the risk of
breaking something is really tiny and the code would become a tad simpler.
Paolo.