Fix re-declared scoped enum as unscoped (Causes issues with some compilers) #13180

pull donaloconnor wants to merge 1 commits into bitcoin:master from donaloconnor:06052018_unscoped_enum changing 1 files +2 −2
  1. donaloconnor commented at 7:14 PM on May 6, 2018: contributor

    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.

  2. in src/rest.cpp:36 in b812c476b2 outdated
      32 | @@ -33,7 +33,7 @@ enum class RetFormat {
      33 |  };
      34 |  
      35 |  static const struct {
      36 | -    enum RetFormat rf;
      37 | +    enum class RetFormat rf;
    


    MarcoFalke commented at 7:28 PM on May 6, 2018:

    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.
    

    donaloconnor commented at 7:35 PM on May 6, 2018:

    argh should have gone with my first version (just removing enum altogether!).

    I'll update the PR soon. Thanks!

  3. MarcoFalke commented at 9:14 PM on May 6, 2018: member
  4. donaloconnor force-pushed on May 6, 2018
  5. donaloconnor closed this on May 6, 2018

  6. donaloconnor force-pushed on May 6, 2018
  7. Remove enum specifier (to avoid re-declare scoped enum as unscoped) 43f3dec009
  8. donaloconnor reopened this on May 6, 2018

  9. donaloconnor commented at 9:53 PM on May 6, 2018: contributor

    Okay - done finally (Got my branch into a messed up state which automatically closed the PR) :(

  10. sipa commented at 10:42 PM on May 6, 2018: member

    utACK 43f3dec009c43c0df2ef4ff62a9327de0148d959

  11. practicalswift commented at 5:06 AM on May 7, 2018: contributor

    utACK 43f3dec009c43c0df2ef4ff62a9327de0148d959

    Thanks for fixing this!

  12. meshcollider added the label Refactoring on May 7, 2018
  13. promag commented at 9:14 AM on May 7, 2018: member

    utACK 43f3dec.

  14. jonasschnelli approved
  15. jonasschnelli commented at 11:27 AM on May 7, 2018: contributor

    utACK 43f3dec009c43c0df2ef4ff62a9327de0148d959

  16. jonasschnelli merged this on May 7, 2018
  17. jonasschnelli closed this on May 7, 2018

  18. jonasschnelli referenced this in commit 6a01a50f49 on May 7, 2018
  19. PastaPastaPasta referenced this in commit 99a94f4e8e on Jun 11, 2020
  20. PastaPastaPasta referenced this in commit e1de0ba2d0 on Jun 11, 2020
  21. PastaPastaPasta referenced this in commit 65d16ff803 on Jun 11, 2020
  22. PastaPastaPasta referenced this in commit d256db036d on Jun 12, 2020
  23. jasonbcox referenced this in commit 3e158f2af4 on Oct 16, 2020
  24. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me