llvm-project/clang/lib
George Burgess IV 850269a47e [Sema] Add warning when comparing nonnull and null
Currently, we emit warnings in some cases where nonnull function
parameters are compared against null. This patch extends this support
to warn when comparing the result of `returns_nonnull` functions
against null.

More specifically, we will now warn cases like:

int *foo() __attribute__((returns_nonnull));
int main() {
  if (foo() == NULL) {} // warning: will always evaluate to false
}

Differential Revision: http://reviews.llvm.org/D15324

llvm-svn: 255058
2015-12-08 22:02:00 +00:00
..
ARCMigrate Refactor: Simplify boolean conditional return statements in lib/ARCMigrate 2015-11-06 01:26:37 +00:00
AST [OPENMP 4.5] Parsing/sema for 'num_tasks' clause. 2015-12-08 12:06:20 +00:00
ASTMatchers Add a narrowing AST matcher that matches on a FunctionDecl with a non-throwing exception specification. 2015-12-02 15:23:59 +00:00
Analysis Use range-based for loop to avoid the need for calculating an array size. NFC 2015-11-30 03:11:12 +00:00
Basic [OPENMP 4.5] Parsing/sema for 'num_tasks' clause. 2015-12-08 12:06:20 +00:00
CodeGen [OPENMP 4.5] Parsing/sema for 'num_tasks' clause. 2015-12-08 12:06:20 +00:00
Driver Replace a bunch of duplicate conditions with the call from types::. 2015-12-08 02:10:19 +00:00
Edit Replace double negation of !FileID.isInvalid() with FileID.isValid(). 2015-10-03 10:46:20 +00:00
Format clang-format: Make wrapping after "./->" cheaper, even if the element 2015-12-07 19:50:48 +00:00
Frontend [diagnostics] Avoid crashes while printing macro backtraces 2015-12-08 01:08:09 +00:00
FrontendTool Provide a BuryPointer for unique_ptrs. 2014-08-29 16:53:14 +00:00
Headers [x86][avx512] more changes in intrinsics to be align with gcc format 2015-12-08 12:34:38 +00:00
Index Roll-back r250822. 2015-10-20 13:23:58 +00:00
Lex [clang] Disable Unicode in asm files 2015-11-20 23:42:39 +00:00
Parse [OPENMP 4.5] Parsing/sema for 'num_tasks' clause. 2015-12-08 12:06:20 +00:00
Rewrite Roll-back r250822. 2015-10-20 13:23:58 +00:00
Sema [Sema] Add warning when comparing nonnull and null 2015-12-08 22:02:00 +00:00
Serialization Use range loops and autos in lib/Serialization/ASTWriter.cpp. 2015-12-08 18:00:11 +00:00
StaticAnalyzer Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule. 2015-12-08 04:21:03 +00:00
Tooling Add fall-back mode for clang tools. 2015-12-03 10:38:53 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00