https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117782
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to kugan from comment #2) > --- a/gcc/cp/mangle.cc > +++ b/gcc/cp/mangle.cc > @@ -1194,6 +1194,7 @@ write_unscoped_name (const tree decl) > in a local function scope. A lambda can also be mangled in the > scope of a default argument. */ > gcc_assert (context == global_namespace > + || TREE_CODE (context) == RECORD_TYPE > || TREE_CODE (context) == PARM_DECL > || TREE_CODE (context) == FUNCTION_DECL); > > Fixes. Definitely the wrong fix.