This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Apr 2016 14:33:09 +0000
- Subject: [Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560
- Auto-submitted: auto-generated
- References: <bug-70639-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70639
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
So I think rather this one:
--- a/gcc/c-family/c-indentation.c
+++ b/gcc/c-family/c-indentation.c
@@ -239,10 +239,11 @@ should_warn_for_misleading_indentation (const
token_indent_info &guard_tinfo,
if (line_table->seen_line_directive)
return false;
- /* We can't usefully warn about do-while statements since the bodies of
these
- statements are always explicitly delimited at both ends, so control flow
is
- quite obvious. */
- if (guard_tinfo.keyword == RID_DO)
+ /* We can't usefully warn about do-while and switch statements since the
+ bodies of these statements are always explicitly delimited at both ends,
+ so control flow is quite obvious. */
+ if (guard_tinfo.keyword == RID_DO
+ || guard_tinfo.keyword == RID_SWITCH)
return false;
/* If the token following the body is a close brace or an "else"