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 222499 clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
clang-tools-extra/clangd/unittests/TweakTests.cpp
|
can you also update the comment to mention
returns null if any child of the parent is not a root statement