ahatanak added inline comments.

================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:6502
+  // except that it has a non-trivial member *with* the trivial_abi attribute.
+  for (auto Base : D->bases()) {
+    if (auto CxxRecord = Base.getType()->getAsCXXRecordDecl())
----------------
It looks like this patch changes the way `D` is passed in the following code:

```
struct B {
  int i[4];
  B();
  B(const B &) = default;
  B(B &&);
};

struct D : B {
  D();
  D(const D &) = default;
  D(D &&) = delete;
};

void testB(B a);
void testD(D a);

void testCallB() {
  B b;
  testB(b);
}

void testCallD() {
  D d;
  testD(d);
}
```

`B` cannot be passed in registers because it has a non-trivial move 
constructor, whereas `D` can be passed in registers because the move 
constructor is deleted and the copy constructor is trivial.

I'm not sure what the best way to handle this is, but I just wanted to point 
this out.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92361/new/

https://reviews.llvm.org/D92361

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to