summaryrefslogtreecommitdiff
path: root/test/SemaCXX/attr-nonnull.cpp
AgeCommit message (Collapse)Author
2014-08-27Fix representation of __attribute__((nonnull)) to support correctly modelingRichard Smith
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
2013-01-24Start checking nonnull (as well as format and argument_with_type_tag) onNick Lewycky
overloaded binary operators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173315 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23Make __attribute__((nonnull)) use the general expression evaluator to search forNick Lewycky
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
2011-03-25Apply the nonnull attribute to constructor expressions too.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15__attribute__((nonnull)) can apply to reference-to-pointerDouglas Gregor
parameters. Fixes <rdar://problem/8769025>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Re-work the handling of implicit 'this' arguments and silly GCC-style attributeChandler Carruth
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