This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560


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"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]