Skip to content

Commit e052833

Browse files
authored
Merge pull request #70342 from hborla/verifier-workaround
[ASTVerifier] Workaround for issue with imported C++ templates.
2 parents 80e86dd + 56e0661 commit e052833

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,14 +2644,17 @@ class Verifier : public ASTWalker {
26442644
abort();
26452645
}
26462646

2647-
// If we are performing pack iteration, variables have to carry the
2648-
// generic environment. Catching the missing environment here will prevent
2649-
// the code from being lowered.
2650-
if (var->getTypeInContext()->is<ErrorType>()) {
2651-
Out << "VarDecl is missing a Generic Environment: ";
2652-
var->getInterfaceType().print(Out);
2653-
Out << "\n";
2654-
abort();
2647+
// FIXME: Workaround for invalid AST for imported C++ templates.
2648+
if (!var->hasClangNode()) {
2649+
// If we are performing pack iteration, variables have to carry the
2650+
// generic environment. Catching the missing environment here will prevent
2651+
// the code from being lowered.
2652+
if (var->getTypeInContext()->is<ErrorType>()) {
2653+
Out << "VarDecl is missing a Generic Environment: ";
2654+
var->getInterfaceType().print(Out);
2655+
Out << "\n";
2656+
abort();
2657+
}
26552658
}
26562659

26572660
// The fact that this is *directly* be a reference storage type

0 commit comments

Comments
 (0)