diff options
author | Eli Friedman <efriedma@quicinc.com> | 2024-04-29 12:00:12 -0700 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2024-05-01 15:56:33 -0700 |
commit | 617a15a9eac96088ae5e9134248d8236e34b91b1 (patch) | |
tree | e9d2cc6ad220dedae13f2324f23924546f91d6ef /clang/test/CodeGen/arm64-microsoft-arguments.cpp | |
parent | 20b9ed64ea074f03057e1d775a1d9d0f067ab0b0 (diff) | |
download | llvm-llvmorg-18.1.5.zip llvm-llvmorg-18.1.5.tar.gz llvm-llvmorg-18.1.5.tar.bz2 |
[clang codegen] Fix MS ABI detection of user-provided constructors. (#90151)llvmorg-18.1.5
In the context of determining whether a class counts as an "aggregate",
a constructor template counts as a user-provided constructor.
Fixes #86384
(cherry picked from commit 3ab4ae9e58c09dfd8203547ba8916f3458a0a481)
Diffstat (limited to 'clang/test/CodeGen/arm64-microsoft-arguments.cpp')
-rw-r--r-- | clang/test/CodeGen/arm64-microsoft-arguments.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/arm64-microsoft-arguments.cpp b/clang/test/CodeGen/arm64-microsoft-arguments.cpp index e830988..8547264 100644 --- a/clang/test/CodeGen/arm64-microsoft-arguments.cpp +++ b/clang/test/CodeGen/arm64-microsoft-arguments.cpp @@ -201,3 +201,18 @@ S11 f11() { S11 x; return func11(x); } + +// GH86384 +// Pass and return object with template constructor (pass directly, +// return indirectly). +// CHECK: define dso_local void @"?f12@@YA?AUS12@@XZ"(ptr dead_on_unwind inreg noalias writable sret(%struct.S12) align 4 {{.*}}) +// CHECK: call void @"?func12@@YA?AUS12@@U1@@Z"(ptr dead_on_unwind inreg writable sret(%struct.S12) align 4 {{.*}}, i64 {{.*}}) +struct S12 { + template<typename T> S12(T*) {} + int x; +}; +S12 func12(S12 x); +S12 f12() { + S12 x((int*)0); + return func12(x); +} |