diff options
author | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
commit | fc74ff5a0792641885551a63d9ddf8cbfdf76e3c (patch) | |
tree | 955a1295c3fd4378a49478ad5835ca21b769417e /test/Analysis/nullptr.cpp | |
parent | 3176e97f130184ece0e1a21352c8124cc83ff24a (diff) | |
download | FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.zip FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.tar.gz |
Vendor import of clang trunk r256945:
https://llvm.org/svn/llvm-project/cfe/trunk@256945
Diffstat (limited to 'test/Analysis/nullptr.cpp')
-rw-r--r-- | test/Analysis/nullptr.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Analysis/nullptr.cpp b/test/Analysis/nullptr.cpp index 17320f3..acc525e 100644 --- a/test/Analysis/nullptr.cpp +++ b/test/Analysis/nullptr.cpp @@ -126,3 +126,22 @@ decltype(nullptr) returnsNullPtrType(); void fromReturnType() { ((X *)returnsNullPtrType())->f(); // expected-warning{{Called C++ object pointer is null}} } + +#define AS_ATTRIBUTE __attribute__((address_space(256))) +class AS1 { +public: + int x; + ~AS1() { + int AS_ATTRIBUTE *x = 0; + *x = 3; // no-warning + } +}; +void test_address_space_field_access() { + AS1 AS_ATTRIBUTE *pa = 0; + pa->x = 0; // no-warning +} +void test_address_space_bind() { + AS1 AS_ATTRIBUTE *pa = 0; + AS1 AS_ATTRIBUTE &r = *pa; + r.x = 0; // no-warning +} |