Author: Timm Bäder Date: 2024-06-29T09:42:37+02:00 New Revision: 58160e78e5ed82bdcc1dcbda4d57442aa4e1dd9e
URL: https://github.com/llvm/llvm-project/commit/58160e78e5ed82bdcc1dcbda4d57442aa4e1dd9e DIFF: https://github.com/llvm/llvm-project/commit/58160e78e5ed82bdcc1dcbda4d57442aa4e1dd9e.diff LOG: [clang][Interp][NFC] Use const pointers in Descriptor::getType() Added: Modified: clang/lib/AST/Interp/Descriptor.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/Interp/Descriptor.cpp b/clang/lib/AST/Interp/Descriptor.cpp index fea8a7b1d14a9..afafae088aca0 100644 --- a/clang/lib/AST/Interp/Descriptor.cpp +++ b/clang/lib/AST/Interp/Descriptor.cpp @@ -355,11 +355,11 @@ Descriptor::Descriptor(const DeclTy &D) } QualType Descriptor::getType() const { - if (auto *E = asExpr()) + if (const auto *E = asExpr()) return E->getType(); - if (auto *D = asValueDecl()) + if (const auto *D = asValueDecl()) return D->getType(); - if (auto *T = dyn_cast<TypeDecl>(asDecl())) + if (const auto *T = dyn_cast<TypeDecl>(asDecl())) return QualType(T->getTypeForDecl(), 0); llvm_unreachable("Invalid descriptor type"); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits