================
@@ -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 {
----------------
kevinwkt wrote:
Good point, the cleanup is automatically handled by the implicit destruction of
the `SavedFPFeatures` member (`Sema::FPFeaturesStateRAII`), but I've added an
explicitly defaulted destructor (`~DefaultedFunctionFPFeaturesRAII() =
default;`) to make the RAII contract clearer to readers.
https://github.com/llvm/llvm-project/pull/207429
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits