-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Fix template parameter printing scheme for const types #79237
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 test |
4a360c2
to
6906d27
Compare
@swift-ci please smoke test |
@swift-ci please test |
Oops, I realized I had left a stray (Also my local tests were "succeeding" because they were unsupported 🙃) |
@swift-ci Please 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.
The ClangImporter part of this change LGTM!
I haven't reviewed the macro changes.
This patch changes the class template printer to disambiguate
const
-qualified template arguments by wrapping them with__cxxConst<>
, rather than suffixing them with_const
.This is necessary to accommodate template arguments that aren't just identifiers (i.e.,
Foo<Int_const>
is ok, butFoo<Bar<T>_const>
andFoo<((Bar) -> Baz)_const>
are not syntactically valid). With this patch, we would produceFoo<__cxxConst<Int>>
,Foo<__cxxConst<Bar<T>>
, andFoo<__cxxConst<((Bar) -> Baz)>>
instead.This patch also disambiguates
volatile
-qualified template arguments with__cxxVolatile<>
, and changes the printing scheme forstd::nullptr_t
fromnil
to__cxxNullPtrT
(sincenil
is not a syntactically valid type name).rdar://143769901