Message ID | 1431530756-26831-1-git-send-email-dmalcolm@redhat.com |
---|---|
State | New |
Headers | show |
On Wed, May 13, 2015 at 11:25:56AM -0400, David Malcolm wrote: > This might qualify as "obvious". > > OK for trunk? (if it passes bootstrap and regrtest) Ok. Marek
diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c index 94565f6..9aeebae 100644 --- a/gcc/c-family/c-indentation.c +++ b/gcc/c-family/c-indentation.c @@ -373,6 +373,12 @@ warn_for_misleading_indentation (location_t guard_loc, enum cpp_ttype next_tok_type, const char *guard_kind) { + /* Early reject for the case where -Wmisleading-indentation is disabled, + to avoid doing work only to have the warning suppressed inside the + diagnostic machinery. */ + if (!warn_misleading_indentation) + return; + if (should_warn_for_misleading_indentation (guard_loc, body_loc, next_stmt_loc,