================
@@ -4058,7 +4059,13 @@ ExpectedDecl
ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) {
}
Error Err = Error::success();
+ if (!UsedDifferentProtoType) {
+ Importer.DeclTypeCycles.insert(D);
----------------
ojhunt wrote:
I kind of want an RAII guard for this, but I'm unsure if it's overkill --
@cor3ntin ? It might also be worth considering a generic RAII guard for this
kind of thing, something like:
```cpp
template <class T> struct RAIIGuard { ... };
..
auto doThing() { return RAIIGuard<ExpectedTypeIfAppropriate>([this](){
this->undoTheThing(); }); }
```
Rather than requiring endless custom RAII objects.
(Very much not for this PR)
https://github.com/llvm/llvm-project/pull/162514
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits