-
Notifications
You must be signed in to change notification settings - Fork 36.7k
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
Fix re-declared scoped enum as unscoped (Causes issues with some compilers) #13180
Fix re-declared scoped enum as unscoped (Causes issues with some compilers) #13180
Conversation
src/rest.cpp
Outdated
@@ -33,7 +33,7 @@ enum class RetFormat { | |||
}; | |||
|
|||
static const struct { | |||
enum RetFormat rf; | |||
enum class RetFormat rf; |
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.
Fails on clang with:
rest.cpp:36:10: error: reference to scoped enumeration must use 'enum' not 'enum class'
enum class RetFormat rf;
^~~~~~
rest.cpp:71:13: error: reference to scoped enumeration must use 'enum' not 'enum class'
static enum class RetFormat ParseDataFormat(std::string& param, const std::string& strReq)
^~~~~~
2 errors generated.
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.
argh should have gone with my first version (just removing enum altogether!).
I'll update the PR soon.
Thanks!
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
2f9430e
to
021993f
Compare
021993f
to
66cc47b
Compare
Okay - done finally (Got my branch into a messed up state which automatically closed the PR) :( |
utACK 43f3dec |
utACK 43f3dec Thanks for fixing this! |
utACK 43f3dec. |
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.
utACK 43f3dec
…with some compilers) 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in #10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Tree-SHA512: 13e21666243585a133c74c81249a1fa4098d6b7aa3cda06be871fa017c0ad9bb7b0725f801160b9d31678448d668718197941fd84702ebdef15128c27d92cd70
…issues with some compilers) 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in bitcoin#10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Tree-SHA512: 13e21666243585a133c74c81249a1fa4098d6b7aa3cda06be871fa017c0ad9bb7b0725f801160b9d31678448d668718197941fd84702ebdef15128c27d92cd70
…issues with some compilers) 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in bitcoin#10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Tree-SHA512: 13e21666243585a133c74c81249a1fa4098d6b7aa3cda06be871fa017c0ad9bb7b0725f801160b9d31678448d668718197941fd84702ebdef15128c27d92cd70
…issues with some compilers) 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in bitcoin#10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Tree-SHA512: 13e21666243585a133c74c81249a1fa4098d6b7aa3cda06be871fa017c0ad9bb7b0725f801160b9d31678448d668718197941fd84702ebdef15128c27d92cd70
…issues with some compilers) 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in bitcoin#10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Tree-SHA512: 13e21666243585a133c74c81249a1fa4098d6b7aa3cda06be871fa017c0ad9bb7b0725f801160b9d31678448d668718197941fd84702ebdef15128c27d92cd70
…with some compilers) Summary: 43f3dec Remove enum specifier (to avoid re-declare scoped enum as unscoped) (donaloconnor) Pull request description: MSVC fails to compile with the changes made in #10742 The problem is enum types were changed to scoped (`enum class`) but in some places `enum` as an unscoped is used. This is a very simple fix and I've tested it. Edit: Had to remove enum altogether - `enum class` doesn't compile on clang. Backport of Core [[bitcoin/bitcoin#13180 | PR13180]] Test Plan: ninja check Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D7965
MSVC fails to compile with the changes made in #10742
The problem is enum types were changed to scoped (
enum class
) but in some placesenum
as an unscoped is used.This is a very simple fix and I've tested it.
Edit: Had to remove enum altogether -
enum class
doesn't compile on clang.