aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@gcc.gnu.org>2003-07-15 23:31:52 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-07-15 23:31:52 +0000
commitb0e3f7ec306dafdaf554f5b3eea03de75cec2a84 (patch)
tree8c95ca0c8979930a9bfa16aad26f060327c7ca5b /gcc/diagnostic.c
parent71628aa09889112d4acdfcea51b85d43808e1d74 (diff)
downloadgcc-b0e3f7ec306dafdaf554f5b3eea03de75cec2a84.zip
gcc-b0e3f7ec306dafdaf554f5b3eea03de75cec2a84.tar.gz
gcc-b0e3f7ec306dafdaf554f5b3eea03de75cec2a84.tar.bz2
re PR c++/11531 (ICE on invalid code (returning to void))
PR c++/11531 * diagnostic.c (diagnostic_report_diagnostic): Don't ICE if we're not recursing on hard error. (diagnostic_for_decl): Likewise. * diagnostic.def: Rearrange. cp/ * typeck.c (check_return_expr): Fix thinko in diagnostic. From-SVN: r69425
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c9bef1a..3475611 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1020,7 +1020,7 @@ void
diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
{
- if (context->lock++)
+ if (context->lock++ && diagnostic->kind < DK_SORRY)
error_recursion (context);
if (diagnostic_count_diagnostic (context, diagnostic))
@@ -1042,7 +1042,7 @@ static void
diagnostic_for_decl (diagnostic_context *context,
diagnostic_info *diagnostic, tree decl)
{
- if (context->lock++)
+ if (context->lock++ && diagnostic->kind < DK_SORRY)
error_recursion (context);
if (diagnostic_count_diagnostic (context, diagnostic))