PR46209: properly determine whether a copy assignment operator is
authorRichard Smith <richard@metafoo.co.uk>
Fri, 5 Jun 2020 02:16:05 +0000 (19:16 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Fri, 5 Jun 2020 02:19:01 +0000 (19:19 -0700)
commitc57f8a3a20540fcf9fbf98c0a73f381ec32fce2a
tree20a1ad1ab9f3c0b5fc4cf1bdaac96698a3fc6852
parentc13dd74e311d2ac70dd3ea663d800307d1aa5b6b
PR46209: properly determine whether a copy assignment operator is
trivial.

We previously took a shortcut by assuming that if a subobject had a
trivial copy assignment operator (with a few side-conditions), we would
always invoke it, and could avoid going through overload resolution.
That turns out to not be correct in the presenve of ref-qualifiers (and
also won't be the case for copy-assignments with requires-clauses
either). Use the same logic for lazy declaration of copy-assignments
that we use for all other special member functions.
18 files changed:
clang/include/clang/AST/CXXRecordDeclDefinitionBits.def
clang/include/clang/AST/DeclCXX.h
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/JSONNodeDumper.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/AST/ast-dump-decl-context-json.cpp
clang/test/AST/ast-dump-decl.cpp
clang/test/AST/ast-dump-expr-json.cpp
clang/test/AST/ast-dump-record-definition-data-json.cpp
clang/test/AST/ast-dump-records-json.cpp
clang/test/AST/ast-dump-records.cpp
clang/test/AST/ast-dump-special-member-functions.cpp
clang/test/AST/ast-dump-template-decls-json.cpp
clang/test/SemaCXX/type-traits.cpp
clang/test/SemaObjCXX/arc-0x.mm
clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp