summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/nullptr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-13 23:31:04 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-13 23:31:04 +0000
commit0476d069e394fec587858985ddee870360aec1ee (patch)
tree49febc5aec69871d253b5bd5daf92db6ca8e6ce2 /clang/test/Analysis/nullptr.cpp
parentb1027a480ac3d0545681e06b94012c95413b2116 (diff)
downloadbcm5719-llvm-0476d069e394fec587858985ddee870360aec1ee.tar.gz
bcm5719-llvm-0476d069e394fec587858985ddee870360aec1ee.zip
PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. This reinstates r345562, reverted in r346065, now that CodeGen's handling of non-odr-used variables has been fixed. llvm-svn: 363337
Diffstat (limited to 'clang/test/Analysis/nullptr.cpp')
-rw-r--r--clang/test/Analysis/nullptr.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/clang/test/Analysis/nullptr.cpp b/clang/test/Analysis/nullptr.cpp
index 38e099b7fbd..e9b975c148a 100644
--- a/clang/test/Analysis/nullptr.cpp
+++ b/clang/test/Analysis/nullptr.cpp
@@ -128,18 +128,10 @@ void shouldNotCrash() {
decltype(nullptr) p; // expected-note{{'p' declared without an initial value}}
if (getSymbol()) // expected-note {{Assuming the condition is false}}
// expected-note@-1{{Taking false branch}}
- // expected-note@-2{{Assuming the condition is false}}
- // expected-note@-3{{Taking false branch}}
- // expected-note@-4{{Assuming the condition is true}}
- // expected-note@-5{{Taking true branch}}
- invokeF(p); // expected-warning{{1st function call argument is an uninitialized value}}
- // expected-note@-1{{1st function call argument is an uninitialized value}}
- if (getSymbol()) // expected-note {{Assuming the condition is false}}
- // expected-note@-1{{Taking false branch}}
// expected-note@-2{{Assuming the condition is true}}
// expected-note@-3{{Taking true branch}}
- invokeF(nullptr); // expected-note {{Calling 'invokeF'}}
- // expected-note@-1{{Passing null pointer value via 1st parameter 'x'}}
+ invokeF(p); // expected-note {{Calling 'invokeF'}}
+ // expected-note@-1{{Passing null pointer value via 1st parameter 'x'}}
if (getSymbol()) { // expected-note {{Assuming the condition is true}}
// expected-note@-1{{Taking true branch}}
X *xx = Type().x; // expected-note {{Null pointer value stored to field 'x'}}
OpenPOWER on IntegriCloud