[clang] d2f6846 - [C99] Update status of DR290, which we do not yet implement

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 09:50:28 PDT 2024


Author: Aaron Ballman
Date: 2024-03-22T12:50:18-04:00
New Revision: d2f684685afeffcffba7e889e7267bce1d905911

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

LOG: [C99] Update status of DR290, which we do not yet implement

Added: 
    clang/test/C/drs/dr290.c

Modified: 
    clang/www/c_dr_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/C/drs/dr290.c b/clang/test/C/drs/dr290.c
new file mode 100644
index 00000000000000..3a6fd1d0dab6f6
--- /dev/null
+++ b/clang/test/C/drs/dr290.c
@@ -0,0 +1,20 @@
+/* RUN: %clang_cc1 -fsyntax-only -ast-dump %s | FileCheck %s
+ */
+
+/* WG14 DR290: no
+ * FLT_EVAL_METHOD and extra precision and/or range
+ *
+ * We retain an implicit conversion based on the float eval method being used
+ * instead of dropping it due to the explicit cast. See GH86304 and C23 6.5.5p7.
+ */
+
+#pragma clang fp eval_method(double)
+_Static_assert((float)(123.0F * 2.0F) == (float)246.0F, "");
+
+// CHECK: StaticAssertDecl
+// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Bool' <IntegralToBoolean>
+// CHECK-NEXT: BinaryOperator {{.*}} 'int' '=='
+// NB: the following implicit cast is incorrect.
+// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double' <FloatingCast> FPEvalMethod=1
+// CHECK-NEXT: CStyleCastExpr {{.*}} 'float' <FloatingCast> FPEvalMethod=1
+

diff  --git a/clang/www/c_dr_status.html b/clang/www/c_dr_status.html
index ed45123ffd0ecb..a41c4f71706769 100644
--- a/clang/www/c_dr_status.html
+++ b/clang/www/c_dr_status.html
@@ -1686,7 +1686,7 @@ <h2 id="cdr">C defect report implementation status</h2>
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_290.htm">290</a></td>
     <td>C99</td>
     <td>FLT_EVAL_METHOD and extra precision and/or range</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="291">
     <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_291.htm">291</a></td>


        


More information about the cfe-commits mailing list