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 23:05:32 +0000 (16:05 -0700)
commit825e3bb58082eafa8db87a9034379b88f892ce9d
tree53414ced6838d1e4d19f148c7539251c85828225
parentebcbd5ba39c017bb621eefa3175a224aae85ddc8
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.

Previously committed as c57f8a3a20540fcf9fbf98c0a73f381ec32fce2a. This
now also includes an extension of LLDB's workaround for handling special
members without the help of Sema to cover copy assignments.
19 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
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp