Adds -Wrange-loop-analysis to -Wall

This makes the range loop warnings part of -Wall.

Fixes PR32823: Warn about accidental coping of data in range based for

Differential Revision: https://reviews.llvm.org/D68912

Recomitted after fixing the warnings it created.
This commit is contained in:
Mark de Wever 2020-01-01 17:23:18 +01:00
parent 1d549cff48
commit eec0240f97
3 changed files with 5 additions and 2 deletions

View File

@ -857,11 +857,11 @@ def Most : DiagGroup<"most", [
CharSubscript,
Comment,
DeleteNonVirtualDtor,
ForLoopAnalysis,
Format,
Implicit,
InfiniteRecursion,
IntInBoolContext,
LoopAnalysis,
MismatchedTags,
MissingBraces,
Move,

View File

@ -8,7 +8,6 @@ CHECK-NEXT: -Wcomment
CHECK-NEXT: -Wdelete-non-virtual-dtor
CHECK-NEXT: -Wdelete-non-abstract-non-virtual-dtor
CHECK-NEXT: -Wdelete-abstract-non-virtual-dtor
CHECK-NEXT: -Wfor-loop-analysis
CHECK-NEXT: -Wformat
CHECK-NEXT: -Wformat-extra-args
CHECK-NEXT: -Wformat-zero-length
@ -21,6 +20,9 @@ CHECK-NEXT: -Wimplicit-function-declaration
CHECK-NEXT: -Wimplicit-int
CHECK-NEXT: -Winfinite-recursion
CHECK-NEXT: -Wint-in-bool-context
CHECK-NEXT: -Wloop-analysis
CHECK-NEXT: -Wfor-loop-analysis
CHECK-NEXT: -Wrange-loop-analysis
CHECK-NEXT: -Wmismatched-tags
CHECK-NEXT: -Wmissing-braces
CHECK-NEXT: -Wmove

View File

@ -1,3 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wall -Wno-unused -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wloop-analysis -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wrange-loop-analysis -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wloop-analysis -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s