File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ const FunctionDecl *findEnclosingFunction(const Node *CommonAnc) {
248
248
// FIXME: Support extraction from templated functions.
249
249
if (Func->isTemplated ())
250
250
return nullptr ;
251
+ if (!Func->getBody ())
252
+ return nullptr ;
251
253
for (const auto *S : Func->getBody ()->children ()) {
252
254
// During apply phase, we perform semantic analysis (e.g. figure out
253
255
// what variables requires hoisting). We cannot perform those when the
Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ F (extracted();)
182
182
183
183
// Shouldn't crash.
184
184
EXPECT_EQ (apply (" void f([[int a]]);" ), " unavailable" );
185
+ EXPECT_EQ (apply (" void f(int a = [[1]]);" ), " unavailable" );
185
186
// Don't extract if we select the entire function body (CompoundStmt).
186
187
std::string CompoundFailInput = R"cpp(
187
188
void f() [[{
You can’t perform that action at this time.
0 commit comments