We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7143b45 commit c3e7707Copy full SHA for c3e7707
clang/lib/AST/ExprCXX.cpp
@@ -511,14 +511,14 @@ DependentScopeDeclRefExpr::CreateEmpty(const ASTContext &Context,
511
}
512
513
SourceLocation CXXConstructExpr::getBeginLoc() const {
514
- if (isa<CXXTemporaryObjectExpr>(this))
515
- return cast<CXXTemporaryObjectExpr>(this)->getBeginLoc();
+ if (const auto *TOE = dyn_cast<CXXTemporaryObjectExpr>(this))
+ return TOE->getBeginLoc();
516
return getLocation();
517
518
519
SourceLocation CXXConstructExpr::getEndLoc() const {
520
521
- return cast<CXXTemporaryObjectExpr>(this)->getEndLoc();
+ return TOE->getEndLoc();
522
523
if (ParenOrBraceRange.isValid())
524
return ParenOrBraceRange.getEnd();
0 commit comments