[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/8] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/8] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
@@ -8485,6 +8485,53 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool HandleLambdaCapture(EvalInfo , const Expr *E, LValue , +const CXXMethodDecl *MD, const

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/7] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -9037,45 +9055,46 @@ class PointerExprEvaluator return Error(E); } bool VisitCXXThisExpr(const CXXThisExpr *E) { -// Can't look at 'this' when checking a potential constant expression. -if (Info.checkingPotentialConstantExpression()) - return false; -

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -8485,6 +8485,53 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool HandleLambdaCapture(EvalInfo , const Expr *E, LValue , +const CXXMethodDecl *MD, const

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -8485,6 +8485,53 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool HandleLambdaCapture(EvalInfo , const Expr *E, LValue , +const CXXMethodDecl *MD, const

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from some coding style guideline nits https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/6] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
@@ -293,6 +293,9 @@ Bug Fixes to C++ Support of templates. Previously we were diagnosing on any non-function template instead of only on class, alias, and variable templates, as last updated by CWG2032. Fixes (#GH#83461) +- Fixed a bug and crashes in constant evaluation

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread via cfe-commits
https://github.com/cor3ntin commented: LGTM but I'll let @AaronBallman approve as I'm in a flight with bad internet today. https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-12 Thread via cfe-commits
Sirraide wrote: Just requested more reviews real quick because this has been open for a month now, and Corentin apparently won’t be able to review prs until April, and I’d also feel a bit bad if I kept pinging just him about this over and over again...

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-11 Thread via cfe-commits
Sirraide wrote: @cor3ntin ping https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-05 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-05 Thread Aaron Ballman via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/5] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/5] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread Aaron Ballman via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/4] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/3] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, Sirraide wrote: That’s probably a better name, yeah;

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, cor3ntin wrote: ```suggestion static bool

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-04 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-20 Thread via cfe-commits
Sirraide wrote: @cor3ntin ping https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-14 Thread via cfe-commits
Sirraide wrote: @cor3ntin ping https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Should I fix the conflict in the release notes myself, or should that be done > when this gets merged? Because at least in my experience, merge conflicts in > the release notes just keep reappearing if a pr stays open for some time... Lets hang out on that for a bit...

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
Sirraide wrote: Should I fix the conflict in the release notes myself, or should that be done when this gets merged? Because at least in my experience, merge conflicts in the release notes just keep reappearing if a pr stays open for some time...

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81102 >From d489acbd3cfb656d203e1f05b74c238351c5428a Mon Sep 17 00:00:00 2001 From: Sirraide Date: Thu, 8 Feb 2024 08:33:03 +0100 Subject: [PATCH 1/2] [Clang] Properly get captured 'this' pointer in lambdas with an

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
@@ -8480,6 +8480,54 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool GetLambdaCaptureAsLValue(EvalInfo , const Expr *E, + LValue , const CXXMethodDecl *MD, +

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
Sirraide wrote: CC @AaronBallman, @cor3ntin, @shafik, @erichkeane, @Endilll https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Sirraide) Changes There were some bugs wrt explicit object parameters in lambdas in the constant evaluator: - The code evaluating a `CXXThisExpr` wasn’t checking for explicit object parameters at all and thus assumed that there was

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread via cfe-commits
https://github.com/Sirraide created https://github.com/llvm/llvm-project/pull/81102 There were some bugs wrt explicit object parameters in lambdas in the constant evaluator: - The code evaluating a `CXXThisExpr` wasn’t checking for explicit object parameters at all and thus assumed that there