xref: /llvm-project/clang/test/SemaCXX/template-64605.cpp (revision 8859c644ede4898f90f77dcad2286de08a9ba62e)
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -ast-dump -ast-dump-filter=b_64605 %s | FileCheck %s
2 
3 // https://github.com/llvm/llvm-project/issues/64605
4 
5 #pragma STDC FENV_ACCESS ON
6 template <typename>
b_64605()7 int b_64605() {
8   int x;
9   if ((float)0xFFFFFFFF != (float)0x100000000) {
10     x = 1;
11   }
12   return x;
13 }
f()14 int f() { return b_64605<void>(); }
15 
16 // CHECK:      ImplicitCastExpr {{.*}} 'float' <IntegralToFloating> RoundingMath=1 AllowFEnvAccess=1
17 // CHECK-NEXT: IntegerLiteral {{.*}} 4294967295
18 
19 // CHECK:      FunctionDecl {{.*}} b_64605 'int ()'
20 // CHECK-NEXT: TemplateArgument type 'void'
21 
22 // CHECK:      ImplicitCastExpr {{.*}} 'float' <IntegralToFloating> RoundingMath=1 AllowFEnvAccess=1
23 // CHECK-NEXT: IntegerLiteral {{.*}} 4294967295
24