forked from OSchip/llvm-project
[clang-tidy] FunctionASTVisitor::TraverseStmt - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
ed5d659038
commit
9acba5206a
|
@ -444,8 +444,7 @@ public:
|
|||
// A little beautification.
|
||||
// For conditional operator "cond ? true : false" point at the "?"
|
||||
// symbol.
|
||||
ConditionalOperator *COp = dyn_cast<ConditionalOperator>(Node);
|
||||
Location = COp->getQuestionLoc();
|
||||
Location = cast<ConditionalOperator>(Node)->getQuestionLoc();
|
||||
}
|
||||
|
||||
// If we have found any reasons, let's account it.
|
||||
|
|
Loading…
Reference in New Issue