[PATCH] D44352: [Concepts] Constrained template parameters

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 03:41:45 PDT 2019


balazske added inline comments.


================
Comment at: lib/AST/ASTImporter.cpp:3708
+  if (Expr *CE = D->getConstraintExpression())
+    R->setConstraintExpression(VisitExpr(CE));
+  return R;
----------------
martong wrote:
> Please use the `import` function instead of `VisitExpr`. Calling `VisitExpr` would return immediately with an error, that's the default case of the `StmtVisitor`.
> Also please check that there was no error during the import of the `CE` expression:
> ```
>   ExpectedExpr CEOrErr = import(D->getConstraintExpression());
>   if (!CEOrErr)
>     return CEOrErr.takeError();
>   R->setConstraintExpression(*CEOrErr);
> ```
> And could you please adjust the changes below too?
The code above works without the `if (Expr *CE = D->getConstraintExpression())` too. The `import` returns `nullptr` for a `nullptr` (`*CEOrErr` will be nullptr and no error).


Repository:
  rC Clang

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

https://reviews.llvm.org/D44352





More information about the cfe-commits mailing list