[c++20] Fix handling of unqualified lookups from a defaulted comparison
authorRichard Smith <richard@metafoo.co.uk>
Thu, 5 Dec 2019 21:37:35 +0000 (13:37 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 10 Dec 2019 01:40:36 +0000 (17:40 -0800)
commit848934c67d484da737b4b92c087bffce069b24ba
tree85ddebae5f1249c32ef844f92e8477946c01f1cf
parent6507e13589687b40530dedc4dec670f2c1bfdc71
[c++20] Fix handling of unqualified lookups from a defaulted comparison
function.

We need to perform unqualified lookups from the context of a defaulted
comparison, but not until we implicitly define the function, at which
point we can't do those lookups any more. So perform the lookup from the
end of the class containing the =default declaration and store the
lookup results on the defaulted function until we synthesize the body.
14 files changed:
clang/include/clang/AST/Decl.h
clang/include/clang/AST/DeclBase.h
clang/include/clang/AST/UnresolvedSet.h
clang/include/clang/Sema/Sema.h
clang/include/clang/Sema/Template.h
clang/lib/AST/Decl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaLambda.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
clang/test/PCH/cxx2a-defaulted-comparison.cpp [new file with mode: 0644]