@@ -1131,13 +1132,18 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD,
QualType Ty,
return false;
if (RD->hasNonTrivialCopyAssignment())
return false;
+ if (RD->needsImplicitCopyAssignment() && !RD->hasSimpleCopyAssignment())
MaxEW707 wrote:
https://github.com/MaxEW707 updated
https://github.com/llvm/llvm-project/pull/90547
>From f404db44d3770cdb8ac5123c16c0b04314eda698 Mon Sep 17 00:00:00 2001
From: MaxEW707
Date: Mon, 29 Apr 2024 22:09:52 -0400
Subject: [PATCH 1/4] [clang][CodeGen] Fix MS ABI for classes with non static
data
MaxEW707 wrote:
> Maybe we should just be testing if the copy-assignment operator is deleted?
> For reference, MSVC also returns the following indirectly:
>
> ```
> struct Test
> {
> int x;
> Test& operator=(const Test&) = delete;
> };
> Test foo();
> Test test(Test x)
> {
> return
https://github.com/efriedma-quic commented:
Maybe we should just be testing if the copy-assignment operator is deleted?
For reference, MSVC also returns the following indirectly:
```
struct Test
{
int x;
Test& operator=(const Test&) = delete;
};
Test foo();
Test test(Test x)
{
@@ -1144,11 +1167,13 @@ bool MicrosoftCXXABI::classifyReturnType(CGFunctionInfo
) const {
if (!RD)
return false;
- bool isTrivialForABI = RD->canPassInRegisters() &&
- isTrivialForMSVC(RD, FI.getReturnType(), CGM);
-
// MSVC always returns
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/90547
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1144,11 +1167,13 @@ bool MicrosoftCXXABI::classifyReturnType(CGFunctionInfo
) const {
if (!RD)
return false;
- bool isTrivialForABI = RD->canPassInRegisters() &&
- isTrivialForMSVC(RD, FI.getReturnType(), CGM);
-
// MSVC always returns
llvmbot wrote:
@llvm/pr-subscribers-clang-codegen
Author: Max Winkler (MaxEW707)
Changes
https://godbolt.org/z/verKj4cnj for reference.
https://godbolt.org/z/z3W9v7o4n for reference.
For global functions and static methods the MSVC ABI returns structs/classes
with a reference type non
https://github.com/MaxEW707 created
https://github.com/llvm/llvm-project/pull/90547
https://godbolt.org/z/verKj4cnj for reference.
https://godbolt.org/z/z3W9v7o4n for reference.
For global functions and static methods the MSVC ABI returns structs/classes
with a reference type non static data