summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/attr-nonnull.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix representation of __attribute__((nonnull)) to support correctly modelingRichard Smith2014-08-271-2/+2
| | | | | | | | | | | | | | | | 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
* Start checking nonnull (as well as format and argument_with_type_tag) onNick Lewycky2013-01-241-0/+12
| | | | | | | overloaded binary operators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173315 91177308-0d34-0410-b5e6-96231b3b80d8
* Make __attribute__((nonnull)) use the general expression evaluator to search forNick Lewycky2013-01-231-0/+9
| | | | | | | | nulls instead of limiting itself to the language-defined "null pointer constant". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173227 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the nonnull attribute to constructor expressions too.Nick Lewycky2011-03-251-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128253 91177308-0d34-0410-b5e6-96231b3b80d8
* __attribute__((nonnull)) can apply to reference-to-pointerDouglas Gregor2010-12-151-0/+11
| | | | | | | parameters. Fixes <rdar://problem/8769025>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121864 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-work the handling of implicit 'this' arguments and silly GCC-style attributeChandler Carruth2010-11-161-0/+18
argument indexes. This handles the offsets in a consistent manner for all of the attributes which I saw working with these concepts. I've also added tests for the attribute that motivated this: nonnull. I consolidated the tests for format attributes into one file, and fleshed them out a bit to trigger more of the warning cases. Also improved the quality of some of the diagnostics that occur with invalid argument indices. The only really questionable change here is supporting the implicit this argument for the ownership attribute. I'm not sure it's really a sensible concept there, but implemented the logic for consistency. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119339 91177308-0d34-0410-b5e6-96231b3b80d8