-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix errors and warnings building swift/PrintAsObjc on Windows using MSVC #6030
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
@@ -821,7 +819,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>, | |||
break; | |||
case NullabilityPrintKind::After: | |||
os << ' '; | |||
[[clang::fallthrough]]; | |||
LLVM_FALLTHROUGH |
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.
This should still have a semicolon after it.
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 spot - its empty on MSVC so never thought of that
@@ -1536,7 +1534,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>, | |||
} | |||
}; | |||
|
|||
class ReferencedTypeFinder : private TypeVisitor<ReferencedTypeFinder> { | |||
class ReferencedTypeFinder : public TypeVisitor<ReferencedTypeFinder> { |
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.
Why does this need to be public?
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.
We get the following error:
1>C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\PrintAsObjC\PrintAsObjC.cpp(1907): error C2247: 'swift::TypeVisitor<`anonymous-namespace'::ReferencedTypeFinder,void>::visit' not accessible because '`anonymous-namespace'::ReferencedTypeFinder' uses 'private' to inherit from 'swift::TypeVisitor<`anonymous-namespace'::ReferencedTypeFinder,void>'
1> C:\Users\hbellamy\Documents\GitHub\my-swift\swift\include\swift/AST/TypeVisitor.h(30): note: see declaration of 'swift::TypeVisitor<`anonymous-namespace'::ReferencedTypeFinder,void>::visit'
1> C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\PrintAsObjC\PrintAsObjC.cpp(1539): note: see declaration of '`anonymous-namespace'::ReferencedTypeFinder'
1> C:\Users\hbellamy\Documents\GitHub\my-swift\swift\lib\PrintAsObjC\PrintAsObjC.cpp(1539): note: see declaration of 'swift::TypeVisitor<`anonymous-namespace'::ReferencedTypeFinder,void>'
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 was going to say "why not just redeclare the visit
method" but I guess it doesn't matter; these are all local helper types anyway.
@swift-ci Please smoke test and merge |
using ASTVisitor::visit
as MSVC considers it to be ambiguous:[[clang::fallthrough]]
by replacing it withLLVM_FALLTHROUGH
ReferencedTypeFinder
publically inherit fromTypeVisitor
due to the following error: