From af4751738db89a142a8880c782d12d4201b222a8 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Thu, 27 Jan 2022 13:55:08 +0100 Subject: [C++] Implement "Deducing this" (P0847R7) This patch implements P0847R7 (partially), CWG2561 and CWG2653. Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D140828 --- clang/lib/Sema/ScopeInfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Sema/ScopeInfo.cpp') diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp index 92ce513..ce90451 100644 --- a/clang/lib/Sema/ScopeInfo.cpp +++ b/clang/lib/Sema/ScopeInfo.cpp @@ -248,6 +248,14 @@ void LambdaScopeInfo::visitPotentialCaptures( } } +bool LambdaScopeInfo::lambdaCaptureShouldBeConst() const { + if (ExplicitObjectParameter) + return ExplicitObjectParameter->getType() + .getNonReferenceType() + .isConstQualified(); + return !Mutable; +} + FunctionScopeInfo::~FunctionScopeInfo() { } BlockScopeInfo::~BlockScopeInfo() { } CapturedRegionScopeInfo::~CapturedRegionScopeInfo() { } -- cgit v1.1