diff --git a/clang/lib/Tooling/Syntax/BuildTree.cpp b/clang/lib/Tooling/Syntax/BuildTree.cpp index 4103a4d92c7d..82c87ba02b74 100644 --- a/clang/lib/Tooling/Syntax/BuildTree.cpp +++ b/clang/lib/Tooling/Syntax/BuildTree.cpp @@ -1059,7 +1059,7 @@ void syntax::TreeBuilder::markStmtChild(Stmt *Child, NodeRole Role) { // This is an expression in a statement position, consume the trailing // semicolon and form an 'ExpressionStatement' node. - if (auto *E = dyn_cast(Child)) { + if (isa(Child)) { setRole(ChildNode, NodeRole::ExpressionStatement_expression); ChildNode = new (allocator()) syntax::ExpressionStatement; // (!) 'getStmtRange()' ensures this covers a trailing semicolon.