aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/Sema/Sema.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Sema/Sema.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/Sema/Sema.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Sema/Sema.h b/contrib/llvm-project/clang/include/clang/Sema/Sema.h
index cfd1c0f977c0..3752a23faa85 100644
--- a/contrib/llvm-project/clang/include/clang/Sema/Sema.h
+++ b/contrib/llvm-project/clang/include/clang/Sema/Sema.h
@@ -710,9 +710,13 @@ public:
return result;
}
+ // Saves the current floating-point pragma stack and clear it in this Sema.
class FpPragmaStackSaveRAII {
public:
- FpPragmaStackSaveRAII(Sema &S) : S(S), SavedStack(S.FpPragmaStack) {}
+ FpPragmaStackSaveRAII(Sema &S)
+ : S(S), SavedStack(std::move(S.FpPragmaStack)) {
+ S.FpPragmaStack.Stack.clear();
+ }
~FpPragmaStackSaveRAII() { S.FpPragmaStack = std::move(SavedStack); }
private:
@@ -722,7 +726,6 @@ public:
void resetFPOptions(FPOptions FPO) {
CurFPFeatures = FPO;
- FpPragmaStack.Stack.clear();
FpPragmaStack.CurrentValue = FPO.getChangesFrom(FPOptions(LangOpts));
}