This revision was automatically updated to reflect the committed changes.
Closed by commit rGc50959431928: [ASTImporter] Import default expression of
param before creating the param. (authored by balazske).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
balazske updated this revision to Diff 214531.
balazske added a comment.
Rename of variables and reformat.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65577/new/
https://reviews.llvm.org/D65577
Files:
clang/include/clang/AST/ASTImporter.h
martong added inline comments.
Comment at: clang/test/Analysis/Inputs/ctu-other.cpp:135
+
+struct DefParmContext {
+ static const int I;
balazske wrote:
> martong wrote:
> > shafik wrote:
> > > martong wrote:
> > > > Perhaps we could write `Default` instead of
balazske added a comment.
Yes importing the parameters should be doable after the create of the function.
I am not sure if it fixes this problem, the parameter that has the default
expression can still be encountered without the default expression set in it.
Repository:
rG LLVM Github
balazske marked an inline comment as done.
balazske added inline comments.
Comment at: clang/test/Analysis/Inputs/ctu-other.cpp:135
+
+struct DefParmContext {
+ static const int I;
martong wrote:
> shafik wrote:
> > martong wrote:
> > > Perhaps we could write
martong added a comment.
Would it be an alternative solution if we imported the function parameters
after we created the FunctionDecl? I guess it would be. Maybe that would result
in a smaller change, what do you think?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
martong accepted this revision.
martong added a comment.
Still looks good to me, other than some style nits.
Comment at: clang/lib/AST/ASTImporter.cpp:3829
+Error ASTNodeImporter::ImportDefaultArgOfParmVarDecl(const ParmVarDecl
*FromParam, ParmVarDecl *ToParam) {
+
balazske updated this revision to Diff 213563.
balazske added a comment.
Small but important fix.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65577/new/
https://reviews.llvm.org/D65577
Files:
clang/include/clang/AST/ASTImporter.h
balazske updated this revision to Diff 213551.
balazske added a comment.
A new kind of solution, the previous does not work always.
Still no test for this new problem case (circular dependency between a
ParmVarDecl and function of it and a CXXDefaultArgExpr that references to the
function
balazske marked 2 inline comments as done.
balazske added inline comments.
Comment at: clang/lib/AST/ASTImporter.cpp:3859
ToTypeSourceInfo, D->getStorageClass(),
/*DefaultArg*/ nullptr))
return ToParm;
shafik added inline comments.
Comment at: clang/lib/AST/ASTImporter.cpp:3859
ToTypeSourceInfo, D->getStorageClass(),
/*DefaultArg*/ nullptr))
return ToParm;
This should be `DefaultArg` now?
martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.
LGTM, though I have some comments.
Comment at: clang/test/Analysis/Inputs/ctu-other.cpp:135
+
+struct DefParmContext {
+ static const int I;
Perhaps we
balazske created this revision.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp.
Herald added a reviewer: martong.
Herald added a reviewer: a.sidorin.
Herald added a reviewer: shafik.
Herald added a project: clang.
The default expression of a parameter variable should be
13 matches
Mail list logo