Hi everyone.
I faced with a strange issue in LLDB starting from LLVM 12 and above on a the following sample:
echo "
template
struct A {};
int main() {
A<A> s;
}
" > sample.cc
clang++ sample.cc -g -O0
lldb-15 a.out -o “breakpoint set -l 6 -f sample.cc” -o “run” -o “frame variable”
The result:
(A<A<> >) s = {}
So the LLDB started to ignore the nested type.
I checked an old LLDB versions and in LLDB 11 the result was:
lldb-11 a.out -o “breakpoint set -l 6 -f sample.cc” -o “run” -o “frame variable”
(A<A< int > >) s = {}
After debugging I found that the cause of this issue was this CL:
https://reviews.llvm.org/D92425
So I tried to add back the empty argument list check.
I replaced this line: llvm-project/DWARFASTParserClang.cpp at main · llvm/llvm-project · GitHub
With the following code:
if (template_param_infos.args.empty() && template_param_infos.names.empty())
return false;
return template_param_infos.args.size() == template_param_infos.names.size();
This solves my problem, however this led to the failure of TestCppIsTypeComplete test. Looks like this CL: ⚙ D112615 [lldb] Make SBType::IsTypeComplete more consistent by forcing the loading of definitions depend on a new behavior.
Does anybody know if there is a good way to fix this issue?