From fc74ff5a0792641885551a63d9ddf8cbfdf76e3c Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 6 Jan 2016 20:02:26 +0000 Subject: Vendor import of clang trunk r256945: https://llvm.org/svn/llvm-project/cfe/trunk@256945 --- test/Analysis/nullptr.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/Analysis/nullptr.cpp') 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 +} -- cgit v1.1