[ASTImporter] Import default expression of param before creating the param.
authorBalazs Keri <1.int32@gmail.com>
Wed, 14 Aug 2019 09:41:39 +0000 (09:41 +0000)
committerBalazs Keri <1.int32@gmail.com>
Wed, 14 Aug 2019 09:41:39 +0000 (09:41 +0000)
commitc50959431928097bbd675ff3a2346813982db176
tree9d2eb3ce3260be37992ecd05c4a85a204b0966f3
parent967583bc087c035fdc4422d05be1030eecf2b241
[ASTImporter] Import default expression of param before creating the param.

Summary:
The default expression of a parameter variable should be imported before
the parameter variable object is created. Otherwise the function is created
with an incomplete parameter variable (default argument is nullptr) and in
this intermediary state the expression is imported. This import can have
a reference to the incomplete parameter variable that causes crash.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D65577

llvm-svn: 368818
clang/include/clang/AST/ASTImporter.h
clang/lib/AST/ASTImporter.cpp
clang/test/Analysis/Inputs/ctu-other.cpp
clang/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
clang/test/Analysis/ctu-main.cpp