[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 30 22:23:05 PST 2020


sepavloff added a comment.

You could check the scope where the pragma appears is the same way as `pragma clang fp` does. The code

  case tok::annot_pragma_fp:
    ProhibitAttributes(Attrs);
    Diag(Tok, diag::err_pragma_fp_scope);
    ConsumeAnnotationToken();
    return StmtError();

is put into `Parser::ParseStatementOrDeclarationAfterAttributes` and it produces errors on misplaced pragma. Probably the same way may work for you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72841/new/

https://reviews.llvm.org/D72841





More information about the cfe-commits mailing list