summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/nullptr.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-12-14 22:41:18 +0000
committerErich Keane <erich.keane@intel.com>2018-12-14 22:41:18 +0000
commit1b9c746034f15aca6039d2369068346f09a2d62f (patch)
tree63959ac27600a588c3216171dc7757e42284a50b /clang/test/Analysis/nullptr.cpp
parent5bf71d11274b388364384771e5cf245985943abe (diff)
downloadbcm5719-llvm-1b9c746034f15aca6039d2369068346f09a2d62f.tar.gz
bcm5719-llvm-1b9c746034f15aca6039d2369068346f09a2d62f.zip
Revert "Add extension to always default-initialize nullptr_t."
This reverts commit 46efdf2ccc2a80aefebf8433dbf9c7c959f6e629. Richard Smith commented just after I submitted this that this is the wrong solution. Reverting so that I can fix differently. llvm-svn: 349206
Diffstat (limited to 'clang/test/Analysis/nullptr.cpp')
-rw-r--r--clang/test/Analysis/nullptr.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/clang/test/Analysis/nullptr.cpp b/clang/test/Analysis/nullptr.cpp
index 1d913c11d3c..38e099b7fbd 100644
--- a/clang/test/Analysis/nullptr.cpp
+++ b/clang/test/Analysis/nullptr.cpp
@@ -125,16 +125,21 @@ struct Type {
};
void shouldNotCrash() {
- decltype(nullptr) p; // expected-note{{'p' initialized to a null pointer value}}
+ 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 true}}
- // expected-note@-3{{Taking true branch}}
- invokeF(p); // expected-note{{Passing null pointer value via 1st parameter 'x'}}
- // expected-note@-1{{Calling 'invokeF'}}
+ // 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}}
- invokeF(nullptr);
+ // 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'}}
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