summaryrefslogtreecommitdiff
path: root/include/clang/Basic/DiagnosticSemaKinds.td
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-06-06 21:39:26 +0000
committerRichard Trieu <rtrieu@google.com>2014-06-06 21:39:26 +0000
commitef6b9cd1c8f0eb49eff480a3ea37b53baffd61f5 (patch)
treec4f786f1c424c8c2a6214da95170aa6847e63033 /include/clang/Basic/DiagnosticSemaKinds.td
parent6cb9eb5cd6a98a2fb13ae499aa5cd3a8feaa14e0 (diff)
downloadclang-ef6b9cd1c8f0eb49eff480a3ea37b53baffd61f5.tar.gz
clang-ef6b9cd1c8f0eb49eff480a3ea37b53baffd61f5.tar.bz2
clang-ef6b9cd1c8f0eb49eff480a3ea37b53baffd61f5.tar.xz
Add -Wtautological-undefined-compare and -Wundefined-bool-conversion warnings
to detect underfined behavior involving pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 34e774671e..20495e73d1 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2400,10 +2400,27 @@ def warn_impcast_pointer_to_bool : Warning<
"address of%select{| function| array}0 '%1' will always evaluate to "
"'true'">,
InGroup<PointerBoolConversion>;
+def warn_this_bool_conversion : Warning<
+ "'this' pointer cannot be null in well-defined C++ code; pointer may be "
+ "assumed always converted to true">, InGroup<UndefinedBoolConversion>;
+def warn_address_of_reference_bool_conversion : Warning<
+ "reference cannot be bound to dereferenced null pointer in well-defined C++ "
+ "code; pointer may be assumed always converted to true">,
+ InGroup<UndefinedBoolConversion>;
+
def warn_null_pointer_compare : Warning<
"comparison of %select{address of|function|array}0 '%1' %select{not |}2"
"equal to a null pointer is always %select{true|false}2">,
InGroup<TautologicalPointerCompare>;
+def warn_this_null_compare : Warning<
+ "'this' pointer cannot be null in well-defined C++ code; comparison may be "
+ "assumed to always evaluate to %select{true|false}0">,
+ InGroup<TautologicalUndefinedCompare>;
+def warn_address_of_reference_null_compare : Warning<
+ "reference cannot be bound to dereferenced null pointer in well-defined C++ "
+ "code; comparison may be assumed to always evaluate to "
+ "%select{true|false}0">,
+ InGroup<TautologicalUndefinedCompare>;
def note_function_warning_silence : Note<
"prefix with the address-of operator to silence this warning">;