https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101219

--- Comment #6 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
gcc internals doc says that binfo should be attached to every class/struct
(RECORD). I'm not sure if this case qualifies. Maybe?

Why this crash happens mechanically? I skimmed through commit 65870e75616ee43
("cp: add support for per-location warning groups.") and found a few places
where warning suppression was removed.

Returning the one around ptrmem prevents the crash from happening:

--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3326,7 +3326,9 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree
member_name)
        member = DECL_CHAIN (member))
     if (DECL_NAME (member) == member_name)
       break;
-  return build_simple_component_ref (ptrmem, member);
+  tree r = build_simple_component_ref (ptrmem, member);
+  suppress_warning(r);
+  return r;
 }

 /* Given an expression PTR for a pointer, return an expression

Reply via email to