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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits