diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-27 04:59:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-27 04:59:42 +0000 |
commit | 2a1084ce0e325230a0f480f2b47ff1128dd98612 (patch) | |
tree | 92d1e28fa7c0421db1e7cd2465f10e0d86556e16 /test/SemaCXX/attr-nonnull.cpp | |
parent | 104bc91e378515da74d19ed4a4ec5d1268bf99c2 (diff) |
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
Diffstat (limited to 'test/SemaCXX/attr-nonnull.cpp')
-rw-r--r-- | test/SemaCXX/attr-nonnull.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/attr-nonnull.cpp b/test/SemaCXX/attr-nonnull.cpp index 8af49d9d29..8fce99759b 100644 --- a/test/SemaCXX/attr-nonnull.cpp +++ b/test/SemaCXX/attr-nonnull.cpp @@ -27,8 +27,8 @@ namespace rdar8769025 { __attribute__((nonnull(2))) void f2(int i, int * const &p); void test_f1() { - f1(0); // expected-warning{{null passed to a callee which requires a non-null argument}} - f2(0, 0); // expected-warning{{null passed to a callee which requires a non-null argument}} + f1(0); // expected-warning{{null passed to a callee that requires a non-null argument}} + f2(0, 0); // expected-warning{{null passed to a callee that requires a non-null argument}} } } |