Skip to content

Fix errors and warnings building swift/IDE on Windows using MSVC #6028

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

Fix errors and warnings building swift/IDE on Windows using MSVC #6028

merged 1 commit into from
Dec 10, 2016

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Dec 2, 2016

  • MSVC is unable to resolve CodeCompletionTypeContextAnalyser:
1>C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\IDE\CodeCompletion.cpp(5090): error C3861: 'TypeAnalyzer': identifier not found
1>C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\IDE\CodeCompletion.cpp(5092): error C2065: 'TypeAnalyzer': undeclared identifier
1>C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\IDE\CodeCompletion.cpp(5092): error C2228: left of '.Analyze' must have class/struct/union
1>C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\IDE\CodeCompletion.cpp(5092): note: type is 'unknown-type'

The fix is to give MSVC a bit more information by qualifying the namespace (global)

  • MSVC can't use decltype as a generic parameter. Fix is to avoid decltype in a generic parameter by substituting the result
  • Fix static_cast: truncation of constant value warning
  • Unhandled control path warnings

Result = ImportsSeen.insert(K);

using PairType = llvm::DenseSet<swift::ide::CodeCompletionCache::Key,
llvm::DenseMapInfo<CodeCompletionCache::Key> >::iterator;
Copy link
Member

Choose a reason for hiding this comment

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

C++11 doesnt require the space between >.

Copy link
Contributor Author

@hughbe hughbe Dec 9, 2016

Choose a reason for hiding this comment

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

Fixed, thanks @compnerd

@compnerd
Copy link
Member

@swift-ci please test and merge

@hughbe
Copy link
Contributor Author

hughbe commented Dec 10, 2016

@compnerd could you try again, tests didn't trigger. Thanks

@compnerd
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit 2383db8 into swiftlang:master Dec 10, 2016

using PairType = llvm::DenseSet<swift::ide::CodeCompletionCache::Key,
llvm::DenseMapInfo<CodeCompletionCache::Key>>::iterator;
std::pair<PairType, bool> Result = ImportsSeen.insert(K);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -5075,7 +5083,7 @@ void CodeCompletionCallbacksImpl::doneParsing() {
if (isDynamicLookup(*ExprType))
Lookup.setIsDynamicLookup();

CodeCompletionTypeContextAnalyzer TypeAnalyzer(CurDeclContext, ParsedExpr);
::CodeCompletionTypeContextAnalyzer TypeAnalyzer(CurDeclContext, ParsedExpr);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hughbe hughbe deleted the ide-msvc branch December 16, 2016 10:57
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