]> granicus.if.org Git - clang/commit
[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)
commita32a62962af96cf1ba050436cb7274133b628f23
tree76723884494c49fa013933e783a8241d572a57c3
parentbe65cfe09ce1c0c619bceddda6d8d02b6e772979
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368818 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTImporter.h
lib/AST/ASTImporter.cpp
test/Analysis/Inputs/ctu-other.cpp
test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
test/Analysis/ctu-main.cpp