PR33924: merge local declarations that have linkage of some kind within
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 29 Jun 2018 21:58:50 +0000 (21:58 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 29 Jun 2018 21:58:50 +0000 (21:58 +0000)
commit5555eac7c61e4c23babf324057c8c361cace0844
tree23b2a35be1732668deea1aa4a662722467565948
parent18087fbc152d7c3e7d756dee48ace1042acc095c
PR33924: merge local declarations that have linkage of some kind within
merged function definitions; also merge functions with deduced return
types.

This seems like two independent fixes, but unfortunately they are hard
to separate because it's challenging to reliably test either one of them
without also testing the other.

A complication arises with deduced return type support: we need the type
of the function in order to know how to merge it, but we can't load the
actual type of the function because it might reference an entity
declared within the function (and we need to have already merged the
function to correctly merge that entity, which we would need to do to
determine if the function types match). So we instead compare the
declared function type when merging functions, and defer loading the
actual type of a function with a deduced type until we've finished
loading and merging the function.

llvm-svn: 336021
clang/include/clang/Serialization/ASTReader.h
clang/lib/Serialization/ASTCommon.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/test/Modules/merge-deduced-return.cpp [new file with mode: 0644]
clang/test/Modules/merge-lambdas.cpp [new file with mode: 0644]
clang/test/Modules/merge-static-locals.cpp [new file with mode: 0644]