Skip to content

Commit 52bfb26

Browse files
authored
[ADT] Fix a minor build error (#104840)
A quick follow-up fix for #99403 Buildbot [reported](https://lab.llvm.org/buildbot/#/builders/168/builds/2330) an error: ``` /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/FunctionExtrasTest.cpp:320:8: error: variable 'ptr' is uninitialized when used here [-Werror,-Wuninitialized] 320 | [ptr](void *self) { | ^~~ /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/FunctionExtrasTest.cpp:318:12: note: initialize the variable 'ptr' to silence this warning 318 | void *ptr; | ^ | = nullptr 1 error generated. ``` So that PR does exactly what's sugested.
1 parent d3864d9 commit 52bfb26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/unittests/ADT/FunctionExtrasTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ TEST(UniqueFunctionTest, InlineStorageWorks) {
316316
// We do assume a couple of implementation details of the unique_function here:
317317
// - It can store certain small-enough payload inline
318318
// - Inline storage size is at least >= sizeof(void*)
319-
void *ptr;
319+
void *ptr = nullptr;
320320
unique_function<void(void *)> UniqueFunctionWithInlineStorage{
321321
[ptr](void *self) {
322322
auto mid = reinterpret_cast<uintptr_t>(&ptr);

0 commit comments

Comments
 (0)