[clang] 71f0359 - Simplify allowing pragma float_control in a linkage specification

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 28 10:29:51 PDT 2021


Author: Aaron Ballman
Date: 2021-07-28T13:29:41-04:00
New Revision: 71f0359a9defbf3e35828189629f166508390d5d

URL: https://github.com/llvm/llvm-project/commit/71f0359a9defbf3e35828189629f166508390d5d
DIFF: https://github.com/llvm/llvm-project/commit/71f0359a9defbf3e35828189629f166508390d5d.diff

LOG: Simplify allowing pragma float_control in a linkage specification

This amends b0ef3d8f666fa6008abb09340b73d9340d442569 based on a suggestion from James Y Knight.

Added: 
    

Modified: 
    clang/lib/Sema/SemaAttr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index b58c092f21e0..c19b44989b5f 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -475,8 +475,7 @@ void Sema::ActOnPragmaFloatControl(SourceLocation Loc,
                                    PragmaFloatControlKind Value) {
   FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
   if ((Action == PSK_Push_Set || Action == PSK_Push || Action == PSK_Pop) &&
-      !(CurContext->isTranslationUnit()) && !CurContext->isNamespace() &&
-      !isa<LinkageSpecDecl>(CurContext)) {
+      !CurContext->getRedeclContext()->isFileContext()) {
     // Push and pop can only occur at file or namespace scope, or within a
     // language linkage declaration.
     Diag(Loc, diag::err_pragma_fc_pp_scope);


        


More information about the cfe-commits mailing list