[modules] Defer merging deduced return types.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 3 Aug 2018 01:00:01 +0000 (01:00 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 3 Aug 2018 01:00:01 +0000 (01:00 +0000)
commita62d198ef5cef0500ea11b4c0c078c024e72f175
tree38b5eca392dd57bdc7afdf6f3c4592385ba5ff39
parent7c84e3810429a04af77b6018d13310ad79346dff
[modules] Defer merging deduced return types.

We can't read a deduced return type until we are sure that the types referred
to by it are not in the middle of being loaded. So defer all reading of such
deduced return types until the end of the recursive deserialization step.

Also, when we load a function type that has a deduced return type, update all
other redeclarations of the function to have that deduced return type.

llvm-svn: 338798
clang/include/clang/Serialization/ASTReader.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/test/Modules/merge-deduced-return.cpp
clang/test/Modules/merge-lambdas.cpp