[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 30 23:46:39 PST 2020
rjmccall added inline comments.
================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:6416
+ if (D->hasAttr<TrivialABIAttr>())
+ return true;
+
----------------
I don't think we can just unconditionally check for the attribute. The rule for `trivial_abi` is that it overrides direct sources of non-triviality, but if there's a subobject which can't be safely passed in registers, we'll still pass aggregates indirectly. This means we can safely add the attribute whenever a class's own special members don't rely on non-triviality without having to recursively check the component types.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92361/new/
https://reviews.llvm.org/D92361
More information about the cfe-commits
mailing list