[PATCH] D65577: [ASTImporter] Import default expression of param before creating the param.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 00:25:19 PDT 2019


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 wrote:
> This should be `DefaultArg` now?
I am not sure if it is always correct, specially in the `hasUninstantiatedDefaultArg` case. (The constructor calls `setDefaultArg` only, probably this was the reason to set the default arg afterwards in different ways that is not doable with the constructor.)


================
Comment at: clang/test/Analysis/Inputs/ctu-other.cpp:144
+
+int testDefParmIncompleteImport(int I) {
+  return fDefParm(I);
----------------
martong wrote:
> `testImportOfIncompleteDefaultParm` ?
The reason for this name was that the import is incomplete, not the the default parameter. (Exactly, before the fix, the import results in a `ParmVarDecl` that is for temporary time interval incomplete when the default expression is missing.) In this way `testIncompleteImportOfDefaultParm` can be better, or `testImportWithIncompleteDefaultParm`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65577/new/

https://reviews.llvm.org/D65577





More information about the cfe-commits mailing list