forked from OSchip/llvm-project
[clangd] Fix crash in DefineInline::prepare()
This commit is contained in:
parent
eb8710cb93
commit
b9213dfec4
|
@ -388,7 +388,7 @@ public:
|
|||
if (!SelNode)
|
||||
return false;
|
||||
Source = getSelectedFunction(SelNode);
|
||||
if (!Source || !Source->isThisDeclarationADefinition())
|
||||
if (!Source || !Source->hasBody())
|
||||
return false;
|
||||
// Only the last level of template parameter locations are not kept in AST,
|
||||
// so if we are inlining a method that is in a templated class, there is no
|
||||
|
|
|
@ -920,6 +920,9 @@ TEST_F(DefineInlineTest, TriggersOnFunctionDecl) {
|
|||
[[(void)(5+3);
|
||||
return;]]
|
||||
}]]
|
||||
|
||||
// Definition with no body.
|
||||
class Bar { Bar() = def^ault; }
|
||||
)cpp");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue