[Bug c++/70449] [6 Regression] ICE with -Wall on valid code on x86_64-linux-gnu in pp_string, at pretty-print.c:928
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 30 08:57:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70449
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Maybe just
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -3312,12 +3312,19 @@ print_instantiation_full_context (diagnostic_context
*context)
if (p)
{
- pp_verbatim (context->printer,
- TREE_CODE (p->decl) == TREE_LIST
- ? _("%s: In substitution of %qS:\n")
- : _("%s: In instantiation of %q#D:\n"),
- LOCATION_FILE (location),
- p->decl);
+ if (location != UNKNOWN_LOCATION)
+ pp_verbatim (context->printer,
+ TREE_CODE (p->decl) == TREE_LIST
+ ? _("%s: In substitution of %qS:\n")
+ : _("%s: In instantiation of %q#D:\n"),
+ LOCATION_FILE (location),
+ p->decl);
+ else
+ pp_verbatim (context->printer,
+ TREE_CODE (p->decl) == TREE_LIST
+ ? _("In substitution of %qS:\n")
+ : _("In instantiation of %q#D:\n"),
+ p->decl);
location = p->locus;
p = p->next;
getting a proper location might be much harder.
More information about the Gcc-bugs
mailing list