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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 03:49:17 PDT 2019


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) {
+  ToParam->setHasInheritedDefaultArg(FromParam->hasInheritedDefaultArg());
----------------
This line seems to be longer than 80 columns, forgot to run clang-format?


================
Comment at: clang/lib/AST/ASTImporter.cpp:6943
+    Optional<ParmVarDecl *> FromParam = Importer.getImportedFromDecl(ToParam);
+    assert(FromParam && "Parameter value was not imported?");
+
----------------
This would be more appropriate I guess: "ParmVarDecl was not imported?"



================
Comment at: clang/test/Analysis/Inputs/ctu-other.cpp:135
+
+struct DefParmContext {
+  static const int I;
----------------
shafik wrote:
> martong wrote:
> > Perhaps we could write `Default` instead of `Def`.
> +1 to this and the name suggestion below.
Please do not forget to rename.


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