Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions clang/lib/Analysis/UninitializedValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,6 @@ void ClassifyRefs::VisitCallExpr(CallExpr *CE) {
const auto *UO = dyn_cast<UnaryOperator>(Ex);
if (UO && UO->getOpcode() == UO_AddrOf)
classify(UO->getSubExpr(), isTrivialBody ? Ignore : ConstPtrUse);
else
classify(Ex, Ignore);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions clang/test/SemaCXX/uninitialized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ void test_const_ptr() {
const int *ptr2;
foo(ptr); // expected-warning {{variable 'ptr' is uninitialized when used here}}
foobar(&ptr2);
int *ptr3; // expected-note {{initialize the variable 'ptr3' to silence this warning}}
const int *ptr4; // expected-note {{initialize the variable 'ptr4' to silence this warning}}
bar(ptr3); // expected-warning {{variable 'ptr3' is uninitialized when used here}}
bar(ptr4); // expected-warning {{variable 'ptr4' is uninitialized when used here}}
}
}

Expand Down
Loading