[clang] [Clang] Check enable_if attribute without delayed diagnostics (PR #176080)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 15 08:21:30 PST 2026
================
@@ -7551,6 +7551,11 @@ EnableIfAttr *Sema::CheckEnableIf(FunctionDecl *Function,
return nullptr;
SFINAETrap Trap(*this);
+ // Perform the access checking immediately so any access diagnostics are
+ // caught by the SFINAE trap.
+ llvm::scope_exit _([&, CurrentState(DelayedDiagnostics.pushUndelayed())] {
----------------
shafik wrote:
@erichkeane made a similar comment in the last version of this PR that this should be explicitly named. This could show up in a stack trace or we may have to step into in a debugger and having a name really helps.
https://github.com/llvm/llvm-project/pull/176080
More information about the cfe-commits
mailing list