diff options
| author | Jakub Kuderski <jakub@nod-labs.com> | 2025-10-30 13:27:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-30 13:27:41 -0400 |
| commit | 0029815af7b8335054345e2f5aacf68ef9d18e81 (patch) | |
| tree | fbaabcc4058fcc15d99665041f598ef19add1e2e /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | |
| parent | 3056727a1ad8d8860d5c4302dd6867e485da38c9 (diff) | |
| download | llvm-0029815af7b8335054345e2f5aacf68ef9d18e81.zip llvm-0029815af7b8335054345e2f5aacf68ef9d18e81.tar.gz llvm-0029815af7b8335054345e2f5aacf68ef9d18e81.tar.bz2 | |
[ADT] Support `.Default` with `nullptr` and `nullopt` values in TypeSwitch (#165724)
In the previous implementation, this would fail for cases like
`TypeSwitch<T*, std::optional<U>>` because `std::nullopt` does not match
`ResultT` exactly and the overload for callable types would be selected.
Add new overloads that support `nullptr` and `std::nullopt`. These can
be added alongside generic callables because we wouldn't want to call
any 'null' function refs anyway.
I selected the `nullptr` and `nullopt` specializations because how often
they appear in the codebase -- currently, you will see lots of code like
`.Default(std::optional<T>())` that can be simplified with this patch.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
0 files changed, 0 insertions, 0 deletions
