[PATCH] D121380: Pragma `clang fp eval_method` needs to take as input a supported value.
Zahira Ammarguellat via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 10 13:20:29 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG15ef06f453c6: Diagnose when `#pragma clang fp eval_method` doesn't have a supported value. (authored by zahiraam).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121380/new/
https://reviews.llvm.org/D121380
Files:
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/test/Sema/fp-eval-pragma.cpp
Index: clang/test/Sema/fp-eval-pragma.cpp
===================================================================
--- clang/test/Sema/fp-eval-pragma.cpp
+++ clang/test/Sema/fp-eval-pragma.cpp
@@ -27,6 +27,16 @@
return 0;
}
+void apply_pragma_with_wrong_value() {
+ // expected-error at +1{{unexpected argument 'value' to '#pragma clang fp eval_method'; expected 'source', 'double' or 'extended'}}
+#pragma clang fp eval_method(value)
+}
+
+int foo3() {
+ apply_pragma_with_wrong_value();
+ return 0;
+}
+
void foo() {
auto a = __FLT_EVAL_METHOD__;
{
Index: clang/include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticParseKinds.td
+++ clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1489,7 +1489,8 @@
"%select{"
"'fast' or 'on' or 'off'|"
"'on' or 'off'|"
- "'ignore', 'maytrap' or 'strict'}2">;
+ "'ignore', 'maytrap' or 'strict'|"
+ "'source', 'double' or 'extended'}2">;
def err_pragma_invalid_keyword : Error<
"invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121380.414481.patch
Type: text/x-patch
Size: 1145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220310/b915febe/attachment.bin>
More information about the cfe-commits
mailing list