llvm-project/clang-tools-extra/test
Javier Alvarez 5ea341d7c4 [clang] Fix trivially copyable for copy constructor and copy assignment operator
From [class.copy.ctor]:

```
A non-template constructor for class X is a copy constructor if its first
parameter is of type X&, const X&, volatile X& or const volatile X&, and
either there are no other parameters or else all other parameters have
default arguments (9.3.4.7).

A copy/move constructor for class X is trivial if it is not user-provided and if:
- class X has no virtual functions (11.7.3) and no virtual base classes (11.7.2), and
- the constructor selected to copy/move each direct base class subobject is trivial, and
- or each non-static data member of X that is of class type (or array thereof),
  the constructor selected to copy/move that member is trivial;

otherwise the copy/move constructor is non-trivial.
```

So `T(T&) = default`; should be trivial assuming that the previous
provisions are met.

This works in GCC, but not in Clang at the moment:
https://godbolt.org/z/fTGe71b6P

Reviewed By: royjacobson

Differential Revision: https://reviews.llvm.org/D127593
2022-06-17 10:35:01 +03:00
..
Unit [CMake] Rename TARGET_TRIPLE to LLVM_TARGET_TRIPLE 2022-03-11 15:43:01 -08:00
clang-apply-replacements [clang-apply-replacements] Added an option to ignore insert conflict. 2022-05-30 13:02:25 +08:00
clang-change-namespace Update redirected output file. 2020-06-19 23:30:16 -07:00
clang-doc [clang-doc] Improving Markdown Output 2020-03-06 17:37:08 -08:00
clang-include-fixer
clang-move [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
clang-query [clang-tooling] Prevent llvm::fatal_error on invalid CLI option 2021-01-29 10:15:06 +01:00
clang-reorder-fields Use function prototypes when appropriate; NFC 2022-02-25 09:08:27 -05:00
clang-tidy [clang] Fix trivially copyable for copy constructor and copy assignment operator 2022-06-17 10:35:01 +03:00
modularize [NFC][clang-tools-extra] Inclusive language: replace master with main 2021-11-25 11:01:16 -06:00
pp-trace [pp-trace] Print HashLoc in InclusionDirective callback 2022-06-03 19:29:59 +08:00
.clang-format
.gitattributes Use `-text` git attribute instead of `text eol=...` 2022-04-28 14:27:29 +02:00
CMakeLists.txt Fix check-clang-tools target after 7cc8377f2c 2022-05-06 23:08:47 +02:00
lit.cfg.py [clang-tools-extra] Reuse llvm_config.use_clang() to set up test environment 2022-03-15 22:14:24 +01:00
lit.site.cfg.py.in [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR 2022-03-25 20:22:01 +01:00