We weren't always checking if children are RootStmts in ExtractFunction.
For void f([[int a]]);, the ParmVarDecl appeared as a RootStmt since
we didn't perform the check and ended up being casted to a (null) Stmt.
Paths 
  |  Differential  D68182  
[Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153) ClosedPublic Authored by SureYeaah on Sep 28 2019, 8:06 AM. 
Details 
 Summary We weren't always checking if children are RootStmts in ExtractFunction. For void f([[int a]]);, the ParmVarDecl appeared as a RootStmt since 
Diff Detail 
 Event Timeline
 Closed by commit rL373471: [Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153) (authored by SureYeaah).  ·  Explain Why This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 222822 clang-tools-extra/trunk/clangd/refactor/tweaks/ExtractFunction.cpp
 clang-tools-extra/trunk/clangd/unittests/TweakTests.cpp
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||