-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Support nested templates for conditional escapability #77678
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
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have one question, otherwise LGTM
auto &argList = specDecl->getTemplateArgs(); | ||
for (auto argToCheck : argumentsToCheck) { | ||
auto arg = argList[argToCheck.first]; | ||
if (arg.getKind() != clang::TemplateArgument::Type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this would work with variadic templates, e.g. std::tuple
? But that's out of scope of this patch 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I think this would not work for that. I'd address that in a follow-up PR.
} | ||
clang::DeclContext *rec = specDecl; | ||
specDecl = nullptr; | ||
while ((rec = rec->getParent())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this loop stop once rec->isTranslationUnit()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When rec->isTranslationUnit()
is true, rec->getParent()
returns null and the loop terminates. That being said, I just realized rec
is a bit confusing name here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that makes sense.
rdar://140115862