Skip to content

[ASTVerifier] Workaround for issue with imported C++ templates. #70342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions lib/AST/ASTVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,14 +2644,17 @@ class Verifier : public ASTWalker {
abort();
}

// If we are performing pack iteration, variables have to carry the
// generic environment. Catching the missing environment here will prevent
// the code from being lowered.
if (var->getTypeInContext()->is<ErrorType>()) {
Out << "VarDecl is missing a Generic Environment: ";
var->getInterfaceType().print(Out);
Out << "\n";
abort();
// FIXME: Workaround for invalid AST for imported C++ templates.
if (!var->hasClangNode()) {
// If we are performing pack iteration, variables have to carry the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the mention of pack iteration here?

// generic environment. Catching the missing environment here will prevent
// the code from being lowered.
if (var->getTypeInContext()->is<ErrorType>()) {
Out << "VarDecl is missing a Generic Environment: ";
var->getInterfaceType().print(Out);
Out << "\n";
abort();
}
}

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