brintos

brintos / llvm-project-archived public Read only

0
0
Text · 733 B · 92b7d77 Raw
21 lines · c
1/* RUN: %clang_cc1 -ast-dump %s | FileCheck %s2 */3 4/* WG14 DR290: no5 * FLT_EVAL_METHOD and extra precision and/or range6 *7 * We retain an implicit conversion based on the float eval method being used8 * instead of dropping it due to the explicit cast. See GH86304 and C23 6.5.5p7.9 */10 11#pragma clang fp eval_method(double)12_Static_assert((float)(123.0F * 2.0F) == (float)246.0F, "");13 14// CHECK: StaticAssertDecl15// CHECK-NEXT: ImplicitCastExpr {{.*}} '_Bool' <IntegralToBoolean>16// CHECK-NEXT: BinaryOperator {{.*}} 'int' '=='17// NB: the following implicit cast is incorrect.18// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double' <FloatingCast> FPEvalMethod=119// CHECK-NEXT: CStyleCastExpr {{.*}} 'float' <FloatingCast> FPEvalMethod=120 21