[PATCH] D63603: [ASTImporter] Propagate error from ImportDeclContext

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 14:04:11 PDT 2019


jkorous added a comment.

I don't have the insight to LGTM the whole change - just a nit about implementation detail.



================
Comment at: clang/lib/AST/ASTImporter.cpp:1724
+  };
+  DefinitionCompleter CompleterRAII(To);
 
----------------
You might consider using just a lambda with `llvm::make_scope_exit`.

https://llvm.org/doxygen/namespacellvm.html#a4896534f3c6278be56967444daf38e3f

For example:
```
To->startDefinition();
auto DefinitionCompleter = llvm::make_scope_exit( [To](){To->completeDefinition();} );
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63603





More information about the cfe-commits mailing list