Skip to content

Commit f349aa8

Browse files
committed
simply some code
1 parent 8522c58 commit f349aa8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,9 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
254254
LocalVisitor Visit);
255255

256256
template <typename T> static bool isRecordWithAttr(QualType Type) {
257-
CXXRecordDecl *RD = Type.getNonReferenceType()->getAsCXXRecordDecl();
258-
if (!RD)
259-
return false;
260-
return RD->hasAttr<T>();
257+
if (auto *RD = Type.getNonReferenceType()->getAsCXXRecordDecl())
258+
return RD->hasAttr<T>();
259+
return false;
261260
}
262261

263262
// Decl::isInStdNamespace will return false for iterators in some STL

0 commit comments

Comments
 (0)