]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/reflection: tweak for eval_has_template_arguments
authorMarek Polacek <polacek@redhat.com>
Wed, 28 Jan 2026 20:43:35 +0000 (15:43 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 29 Jan 2026 13:45:20 +0000 (08:45 -0500)
commit397b0827bcd40eb9b0c5c4bfae7a3dcb2030cef2
tree1b216b9839ed9c405b316051e0fed6c72a43b2d9
parentec8ec2755f0bc387dddaa8920b1154455e0ee7fe
c++/reflection: tweak for eval_has_template_arguments

As discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705756.html>:

> For reflection it's probably best to go with
>
> if (TYPE_P (r) && typedef_variant_p (r))
>   return alias_template_specialization_p (r, nt_opaque);
>
> and not get into primary_template_specialization_p at all.

Here in a patch form.

gcc/cp/ChangeLog:

* reflect.cc (eval_has_template_arguments): Return immediately after
checking alias_template_specialization_p.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/reflect.cc