Happens when DestContext is LinkageSpecDecl and hense CurContext happens to be
both not TagDecl and NamespaceDecl.
Minimal reproducer: trigger define outline in
namespace ns {
extern "C" {
typedef int foo;
}
foo Fo^o(int id) { return id; }
} Differential D107047
[clangd] Fix the crash in getQualification Authored by kbobyrev on Jul 29 2021, 2:30 AM.
Details
Happens when DestContext is LinkageSpecDecl and hense CurContext happens to be Minimal reproducer: trigger define outline in namespace ns {
extern "C" {
typedef int foo;
}
foo Fo^o(int id) { return id; }
}
Diff Detail
Event TimelineComment Actions thanks for chasing this down! as mentioned offline a test case like: namespace ns {
extern "C" {
typedef int foo;
}
foo Fo^o(int id) { return id; }
}in define outline should be enough to ensure it is WAI.
| ||||||||
rather than having !NNS in the check below it might be nicer to put:
else { // Other types of contexts cannot be spelled in code, just skip over them. continue; }I believe continue makes sense, that way we can spell in cases like:
namespace ns { extern "C" { typedef int foo; } foo Foo(int id) { return id; } }foo should still become ns::foo in other contexts.