Skip to content

Fix MSVC errors compiling GenericSignature.h #6306

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 20, 2016
Merged

Fix MSVC errors compiling GenericSignature.h #6306

merged 1 commit into from
Dec 20, 2016

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Dec 15, 2016

This is because MSVC doesn't support auto function pointers as template parameters and bugs out with the following message:

source_file.cpp(19): error C2275: 'CanType': illegal use of this type as an expression
source_file.cpp(8): note: see declaration of 'CanType'
source_file.cpp(19): error C2146: syntax error: missing ')' before identifier 'dependentType'
source_file.cpp(19): error C2146: syntax error: missing '>' before identifier 'conformedProtocol'
source_file.cpp(22): error C2977: 'function_ref': too many template arguments
source_file.cpp(6): note: see declaration of 'function_ref'

I've also made a connect bug for this: https://connect.microsoft.com/VisualStudio/feedback/details/3116499

-> Optional<ProtocolConformanceRef>>;
using GenericFunction = auto(CanType canType, Type conformingReplacementType,
ProtocolType *conformedProtocol)
->Optional<ProtocolConformanceRef>;
Copy link
Member

Choose a reason for hiding this comment

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

Its not your change, but Im not sure I understand the point of the trailing return with the auto. Also, can you clang-format that line? Pretty sure that it will add a space between -> and the return type.

Copy link
Contributor Author

@hughbe hughbe Dec 15, 2016

Choose a reason for hiding this comment

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

This was what clang-format produced for me

@DougGregor
Copy link
Member

@swift-ci please smoke test

@compnerd
Copy link
Member

@swift-ci please smoke test

@compnerd compnerd merged commit 035e179 into swiftlang:master Dec 20, 2016
@hughbe hughbe deleted the silgen-msvc-fixes branch December 23, 2016 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants