forked from OSchip/llvm-project
Revert r152745 as it's breaking the internal buildbots.
Abbreviated commit message: Provide -Wnull-conversion separately from -Wconversion. llvm-svn: 152765
This commit is contained in:
parent
6d64bd4639
commit
2860fbb747
|
@ -28,7 +28,6 @@ def Availability : DiagGroup<"availability">;
|
||||||
def AutoImport : DiagGroup<"auto-import">;
|
def AutoImport : DiagGroup<"auto-import">;
|
||||||
def BoolConversions : DiagGroup<"bool-conversions">;
|
def BoolConversions : DiagGroup<"bool-conversions">;
|
||||||
def IntConversions : DiagGroup<"int-conversions">;
|
def IntConversions : DiagGroup<"int-conversions">;
|
||||||
def NullConversion : DiagGroup<"null-conversion">;
|
|
||||||
def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
|
def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
|
||||||
def CXXCompat: DiagGroup<"c++-compat">;
|
def CXXCompat: DiagGroup<"c++-compat">;
|
||||||
def CastAlign : DiagGroup<"cast-align">;
|
def CastAlign : DiagGroup<"cast-align">;
|
||||||
|
@ -283,7 +282,6 @@ def Parentheses : DiagGroup<"parentheses",
|
||||||
// - conversion warnings with constant sources are on by default
|
// - conversion warnings with constant sources are on by default
|
||||||
// - conversion warnings for literals are on by default
|
// - conversion warnings for literals are on by default
|
||||||
// - bool-to-pointer conversion warnings are on by default
|
// - bool-to-pointer conversion warnings are on by default
|
||||||
// - __null-to-integer conversion warnings are on by default
|
|
||||||
def Conversion : DiagGroup<"conversion",
|
def Conversion : DiagGroup<"conversion",
|
||||||
[DiagGroup<"shorten-64-to-32">,
|
[DiagGroup<"shorten-64-to-32">,
|
||||||
DiagGroup<"constant-conversion">,
|
DiagGroup<"constant-conversion">,
|
||||||
|
@ -291,7 +289,6 @@ def Conversion : DiagGroup<"conversion",
|
||||||
DiagGroup<"string-conversion">,
|
DiagGroup<"string-conversion">,
|
||||||
DiagGroup<"sign-conversion">,
|
DiagGroup<"sign-conversion">,
|
||||||
BoolConversions,
|
BoolConversions,
|
||||||
NullConversion,
|
|
||||||
IntConversions]>,
|
IntConversions]>,
|
||||||
DiagCategory<"Value Conversion Issue">;
|
DiagCategory<"Value Conversion Issue">;
|
||||||
|
|
||||||
|
@ -360,9 +357,6 @@ def : DiagGroup<"all", [Most, Parentheses, Switch]>;
|
||||||
def : DiagGroup<"", [Extra]>; // -W = -Wextra
|
def : DiagGroup<"", [Extra]>; // -W = -Wextra
|
||||||
def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wendif-tokens
|
def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wendif-tokens
|
||||||
def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
|
def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
|
||||||
def : DiagGroup<"conversion-null",
|
|
||||||
[NullConversion]>; // -Wconversion-null = -Wnull-conversion
|
|
||||||
|
|
||||||
|
|
||||||
// A warning group for warnings that we want to have on by default in clang,
|
// A warning group for warnings that we want to have on by default in clang,
|
||||||
// but which aren't on by default in GCC.
|
// but which aren't on by default in GCC.
|
||||||
|
|
|
@ -1732,7 +1732,7 @@ def warn_impcast_bool_to_null_pointer : Warning<
|
||||||
"expression">, InGroup<BoolConversions>;
|
"expression">, InGroup<BoolConversions>;
|
||||||
def warn_impcast_null_pointer_to_integer : Warning<
|
def warn_impcast_null_pointer_to_integer : Warning<
|
||||||
"implicit conversion of NULL constant to integer">,
|
"implicit conversion of NULL constant to integer">,
|
||||||
InGroup<NullConversion>;
|
InGroup<DiagGroup<"conversion">>, DefaultIgnore;
|
||||||
def warn_impcast_function_to_bool : Warning<
|
def warn_impcast_function_to_bool : Warning<
|
||||||
"address of function %q0 will always evaluate to 'true'">,
|
"address of function %q0 will always evaluate to 'true'">,
|
||||||
InGroup<BoolConversions>;
|
InGroup<BoolConversions>;
|
||||||
|
|
|
@ -3168,7 +3168,6 @@ void darwin::CC1::RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const {
|
||||||
.Case("c++11-narrowing", true)
|
.Case("c++11-narrowing", true)
|
||||||
.Case("conditional-uninitialized", true)
|
.Case("conditional-uninitialized", true)
|
||||||
.Case("constant-conversion", true)
|
.Case("constant-conversion", true)
|
||||||
.Case("conversion-null", true)
|
|
||||||
.Case("CFString-literal", true)
|
.Case("CFString-literal", true)
|
||||||
.Case("constant-logical-operand", true)
|
.Case("constant-logical-operand", true)
|
||||||
.Case("custom-atomic-properties", true)
|
.Case("custom-atomic-properties", true)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// RUN: %clang_cc1 -std=c++11 -Wno-conversion-null -analyze -analyzer-checker=core -analyzer-store region -verify %s
|
// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core -analyzer-store region -verify %s
|
||||||
|
|
||||||
// test to see if nullptr is detected as a null pointer
|
// test to see if nullptr is detected as a null pointer
|
||||||
void foo1(void) {
|
void foo1(void) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -Wno-null-conversion -fsyntax-only -verify
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
|
||||||
// RUN: %clang_cc1 -triple i686-unknown-unknown %s -Wno-null-conversion -fsyntax-only -verify
|
// RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify
|
||||||
|
|
||||||
void f() {
|
void f() {
|
||||||
int* i = __null;
|
int* i = __null;
|
||||||
|
|
|
@ -53,14 +53,10 @@ namespace test2 {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// This file tests -Wnull-conversion, a subcategory of -Wconversion
|
|
||||||
// which is on by default.
|
|
||||||
|
|
||||||
void test3() {
|
void test3() {
|
||||||
int a = NULL; // expected-warning {{implicit conversion of NULL constant to integer}}
|
int a = NULL; // expected-warning {{implicit conversion of NULL constant to integer}}
|
||||||
int b;
|
int b;
|
||||||
b = NULL; // expected-warning {{implicit conversion of NULL constant to integer}}
|
b = NULL; // expected-warning {{implicit conversion of NULL constant to integer}}
|
||||||
long l = NULL; // FIXME: this should also warn, but currently does not if sizeof(NULL)==sizeof(inttype)
|
|
||||||
int c = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
|
int c = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
|
||||||
int d;
|
int d;
|
||||||
d = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
|
d = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
|
||||||
|
|
Loading…
Reference in New Issue