Skip to content

Commit 916a10f

Browse files
committed
[clang] Add zero-initialization for fixed point types
1 parent cf401f7 commit 916a10f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11427,6 +11427,10 @@ class FixedPointExprEvaluator
1142711427
return true;
1142811428
}
1142911429

11430+
bool ZeroInitialization(const Expr *E) {
11431+
return Success(0, E);
11432+
}
11433+
1143011434
//===--------------------------------------------------------------------===//
1143111435
// Visitor Methods
1143211436
//===--------------------------------------------------------------------===//
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %clang_cc1 -ffixed-point -S -emit-llvm %s -o - | FileCheck %s
2+
3+
// CHECK: @_ZL1a = internal constant [2 x i32] zeroinitializer
4+
constexpr _Accum a[2] = {};
5+
6+
void func2(const _Accum *);
7+
void func() {
8+
func2(a);
9+
}

0 commit comments

Comments
 (0)