[clang] [clang] SFINAE context refactor (PR #164703)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 23 07:23:48 PDT 2025
================
@@ -12394,45 +12391,65 @@ class Sema final : public SemaBase {
/// failures rather than hard errors.
bool AccessCheckingSFINAE;
+ class SFINAETrap;
+
+ struct SFINAEContextBase {
+ SFINAEContextBase(Sema &S, SFINAETrap *Cur)
+ : S(S), Prev(std::exchange(S.CurrentSFINAEContext, Cur)) {}
+
+ protected:
+ Sema &S;
+ ~SFINAEContextBase() { S.CurrentSFINAEContext = Prev; }
+
+ private:
+ SFINAETrap *Prev;
+ };
+
+ struct NonSFINAEContext : SFINAEContextBase {
----------------
mizvekov wrote:
I think having both the 'Context' and 'RAII' qualifiers would be a bit too much, feels redundant to me.
https://github.com/llvm/llvm-project/pull/164703
More information about the cfe-commits
mailing list