[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-27 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/124426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-27 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/124426 >From 139531b49ec955e357a876125f8db6a39cf43579 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sat, 25 Jan 2025 20:45:29 +0100 Subject: [PATCH 1/2] [Clang] only inherit the parent eval context inside of la

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/124426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/124426 >From 8462731de5711879ad86919dbc06112d8136b2ba Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sat, 25 Jan 2025 20:45:29 +0100 Subject: [PATCH 1/2] [Clang] only inherit the parent eval context inside of la

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-26 Thread Timm Baeder via cfe-commits
@@ -35,6 +36,12 @@ inline bool isLambdaCallOperator(const DeclContext *DC) { return isLambdaCallOperator(cast(DC)); } +inline bool isLambdaMethod(const DeclContext *DC) { + if (auto *MD = dyn_cast_or_null(DC); MD) tbaederr wrote: ```suggestion if (const

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-26 Thread via cfe-commits
@@ -13108,14 +13109,16 @@ class Sema final : public SemaBase { ? ExpressionEvaluationContext::ImmediateFunctionContext : ExpressionEvaluationContext::PotentiallyEvaluated); if (FD) { +auto &Current = S.currentEvaluationContext(), +

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes As we create defaul constructors lazily, we should not inherit from the parent evaluation context. However, we need to make an exception for lambdas (in particular their conversion operators, which are also imp

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-25 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/124426 As we create defaul constructors lazily, we should not inherit from the parent evaluation context. However, we need to make an exception for lambdas (in particular their conversion operators, which are also im