]> granicus.if.org Git - clang/commit
Skip NonNull sema checks in unevaluated contexts.
authorEric Fiselier <eric@efcs.ca>
Fri, 9 Oct 2015 00:17:57 +0000 (00:17 +0000)
committerEric Fiselier <eric@efcs.ca>
Fri, 9 Oct 2015 00:17:57 +0000 (00:17 +0000)
commitf4915600f775ae21d7e8d31fad7f4a18d33b9fd8
tree4d995be90572931028be548c910f6acd3edc08f3
parent1285f36d338858486ecaeffa7a9404419df3c262
Skip NonNull sema checks in unevaluated contexts.

Summary:
Currently when a function annotated with __attribute__((nonnull)) is called in an unevaluated context with a null argument a -Wnonnull warning is emitted.
This warning seems like a false positive unless the call expression is potentially evaluated. Change this behavior so that the non-null warnings use DiagRuntimeBehavior so they wont emit when they won't be evaluated.

Reviewers: majnemer, rsmith

Subscribers: mclow.lists, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249787 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/Sema/non-null-warning.c