[clang] [Clang][Sema] Ensure explicitly defaulted functions respect FP pragmas from their declaration site (PR #207429)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 11:47:36 PDT 2026


================
@@ -6906,6 +6906,25 @@ Sema::getDefaultedFunctionKind(const FunctionDecl *FD) {
   return DefaultedFunctionKind();
 }
 
+namespace {
+/// RAII object to restore the floating-point (FP) features active at the time
+/// a defaulted function was declared. This ensures that the synthesized body
+/// of the function respects the FP pragmas (e.g., #pragma STDC FENV_ACCESS)
+/// that were in effect when the function was explicitly defaulted.
+struct DefaultedFunctionFPFeaturesRAII {
----------------
shafik wrote:

I would expect an RAII object to have a destrutor.

https://github.com/llvm/llvm-project/pull/207429


More information about the cfe-commits mailing list