From 096c033634d230fdb5eae4a0c3777e629cce0d82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sat, 12 Nov 2022 18:06:06 +0100 Subject: [PATCH] [clang][sema][NFC] Make some local variables const We don't modify them. Also use auto here since we already wrote the full type in the cast. --- clang/lib/Sema/SemaTemplate.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 08ff4f4..bb419e7 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -109,7 +109,7 @@ NamedDecl *Sema::getAsTemplateNameDecl(NamedDecl *D, return D; } - if (CXXRecordDecl *Record = dyn_cast(D)) { + if (const auto *Record = dyn_cast(D)) { // C++ [temp.local]p1: // Like normal (non-template) classes, class templates have an // injected-class-name (Clause 9). The injected-class-name @@ -126,8 +126,7 @@ NamedDecl *Sema::getAsTemplateNameDecl(NamedDecl *D, if (Record->getDescribedClassTemplate()) return Record->getDescribedClassTemplate(); - if (ClassTemplateSpecializationDecl *Spec - = dyn_cast(Record)) + if (const auto *Spec = dyn_cast(Record)) return Spec->getSpecializedTemplate(); } -- 2.7.4