diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/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'">; diff --git a/clang/test/Sema/fp-eval-pragma.cpp b/clang/test/Sema/fp-eval-pragma.cpp --- a/clang/test/Sema/fp-eval-pragma.cpp +++ b/clang/test/Sema/fp-eval-pragma.cpp @@ -27,6 +27,16 @@ return 0; } +void apply_pragma_with_wrong_value() { + // expected-error@+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__; {