[Lldb-commits] [lldb] add explicit default initialization to DemangledNameInfo to remove warning (PR #141790)
via lldb-commits
lldb-commits at lists.llvm.org
Wed May 28 08:21:06 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Charles Zablit (charles-zablit)
<details>
<summary>Changes</summary>
https://github.com/llvm/llvm-project/pull/140762 introduces some compilation warnings in `lldb/unittests/Core/MangledTest.cpp`. This patch adds explicit default initialization to `DemangledNameInfo` to suppress those warnings.
We only had the default initialization values to `PrefixRange` and `SuffixRange` because they are the only _optional_ fields of the structure.
---
Full diff: https://github.com/llvm/llvm-project/pull/141790.diff
1 Files Affected:
- (modified) lldb/include/lldb/Core/DemangledNameInfo.h (+2-2)
``````````diff
diff --git a/lldb/include/lldb/Core/DemangledNameInfo.h b/lldb/include/lldb/Core/DemangledNameInfo.h
index ab9bb3e211b66..e26adc7035a56 100644
--- a/lldb/include/lldb/Core/DemangledNameInfo.h
+++ b/lldb/include/lldb/Core/DemangledNameInfo.h
@@ -62,12 +62,12 @@ struct DemangledNameInfo {
/// Indicates the [start, end) of the function's prefix. This is a
/// catch-all range for anything that is not tracked by the rest of
/// the pairs.
- std::pair<size_t, size_t> PrefixRange;
+ std::pair<size_t, size_t> PrefixRange{};
/// Indicates the [start, end) of the function's suffix. This is a
/// catch-all range for anything that is not tracked by the rest of
/// the pairs.
- std::pair<size_t, size_t> SuffixRange;
+ std::pair<size_t, size_t> SuffixRange{};
/// Returns \c true if this object holds a valid basename range.
bool hasBasename() const {
``````````
</details>
https://github.com/llvm/llvm-project/pull/141790
More information about the lldb-commits
mailing list