mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 01:46:06 +00:00

This patch fixes initializing temporaries, which are currently initialized without an address space, meaning that no constructor can ever be applicable. Now they will be constructed in the private addrspace. Fixes the second issue in PR43296. Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D107553
20 lines
418 B
Plaintext
20 lines
418 B
Plaintext
// RUN: %clang_cc1 %s -pedantic -ast-dump | FileCheck %s
|
|
|
|
struct X {
|
|
X() __private = default;
|
|
};
|
|
|
|
// CHECK: VarDecl {{.*}} gx
|
|
// CHECK: CXXTemporaryObjectExpr {{.*}} '__private X'
|
|
__global X gx = X();
|
|
|
|
void k() {
|
|
// CHECK: VarDecl {{.*}} x1
|
|
// CHECK: CXXTemporaryObjectExpr {{.*}} '__private X'
|
|
X x1 = X();
|
|
|
|
// CHECK: VarDecl {{.*}} x2
|
|
// CHECK: CXXConstructExpr {{.*}} 'const __private X'
|
|
const X x2;
|
|
}
|