]> granicus.if.org Git - clang/commit
Fix representation of __attribute__((nonnull)) to support correctly modeling
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 27 Aug 2014 04:59:42 +0000 (04:59 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 27 Aug 2014 04:59:42 +0000 (04:59 +0000)
commit2a1084ce0e325230a0f480f2b47ff1128dd98612
tree92d1e28fa7c0421db1e7cd2465f10e0d86556e16
parent104bc91e378515da74d19ed4a4ec5d1268bf99c2
Fix representation of __attribute__((nonnull)) to support correctly modeling
the no-arguments case. Don't expand this to an __attribute__((nonnull(A, B,
C))) attribute, since that does the wrong thing for function templates and
varargs functions.

In passing, fix a grammar error in the diagnostic, a crash if
__attribute__((nonnull(N))) is applied to a varargs function,
a bug where the same null argument could be diagnosed multiple
times if there were multiple nonnull attributes referring to it,
and a bug where nonnull attributes would not be accumulated correctly
across redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216520 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDeclAttr.cpp
lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
test/Sema/nonnull.c
test/Sema/static-array.c
test/SemaCXX/attr-nonnull.cpp
test/SemaCXX/nonnull.cpp
test/SemaObjC/nonnull.m