On Mon, Oct 19, 2026 at 04:09:01PM -0400, Jason Merrill wrote:
> On 10/13/26 3:32 AM, Jakub Jelinek wrote:
> > The following testcase ICEs during SRA, where it decides to call
> > type_contains_placeholder_p on the A type. type_contains_placeholder_1
> > handles all kinds of types, including NULLPTR_TYPE, but obviously doesn't
> > handle LANG_TYPE, it doesn't know what LANG_TYPE is and whether it contains
> > placeholders or not.
> > We could handle LANG_TYPE with just specific flag or specific name (I think
> > the former is what we are converging to for LTO) in that function, but we
> > already have a mechanism to cache that value in the types, so even without
> > that magic flag on LANG_TYPE we can just say that the type never contains
> > a placeholder when we create the type.
> >
> > 2026-10-13 Jakub Jelinek <[email protected]>
> >
> > PR c++/127856
> > * reflect.cc (init_reflection): Set TYPE_CONTAINS_PLACEHOLDER_INTERNAL
> > on meta_info_type_node to 1.
> >
> > * g++.dg/reflect/pr127856.C: New test.
> >
> > --- a/gcc/cp/reflect.cc 2026-09-30 08:56:53.834224955 +0200
> > +++ b/gcc/cp/reflect.cc 2026-10-12 16:41:07.965736245 +0200
> > @@ -69,6 +69,7 @@ init_reflection ()
> > TYPE_PRECISION (meta_info_type_node) = GET_MODE_BITSIZE (ptr_mode);
> > SET_TYPE_MODE (meta_info_type_node, ptr_mode);
> > SET_TYPE_ALIGN (meta_info_type_node, GET_MODE_ALIGNMENT (ptr_mode));
> > + TYPE_CONTAINS_PLACEHOLDER_INTERNAL (meta_info_type_node) = 1;
>
> A workaround like this really needs a comment.
>
> OK with that addition.
This patch isn't needed anymore if Marek's OPAQUE_TYPE patch is committed,
and not needed on 16 branch because it doesn't have P4101 support.
So, I'm withdrawing this patch.
Jakub