File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -850,12 +850,14 @@ CodeGenTypes::getCGRecordLayout(const RecordDecl *RD) {
850850}
851851
852852bool CodeGenTypes::isPointerZeroInitializable (QualType T) {
853- assert ((T->isAnyPointerType () || T->isBlockPointerType ()) && " Invalid type" );
853+ assert ((T->isAnyPointerType () || T->isBlockPointerType () ||
854+ T->isNullPtrType ()) &&
855+ " Invalid type" );
854856 return isZeroInitializable (T);
855857}
856858
857859bool CodeGenTypes::isZeroInitializable (QualType T) {
858- if (T->getAs <PointerType>())
860+ if (T->getAs <PointerType>() || T-> isNullPtrType () )
859861 return Context.getTargetNullPointerValue (T) == 0 ;
860862
861863 if (const auto *AT = Context.getAsArrayType (T)) {
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -std=c++20 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
2+
3+ using ulong = unsigned long ;
4+ template <class ... Ts>
5+ void g (Ts... args) {
6+ ulong arr[3 ] = {ulong (args)...};
7+ (void )arr;
8+ }
9+ extern void f () {
10+ g (nullptr , 17 );
11+ }
12+
13+ // CHECK: {{^}} store i64 0, ptr %arr, align 8{{$}}
You can’t perform that action at this time.
0 commit comments