http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52759
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-29 08:41:57 UTC --- Created attachment 27026 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27026 gcc48-pr52759.patch Untested fix. The assert in mangle.c doesn't like mangling during processing_template_decl, so we should avoid calling it then. Perhaps we could instead call maybe_apply_pragma_weak somewhere in pt.c when we actually instantiate it (though that would go beyond what we were doing so far and most template instantiations will be weak already anyway).