Menu

#1006 Compiler GCC - Use correct option for C++20 depending on version

Next_Nightly
applied
Patch
2021-03-17
2020-08-13
No

A post in the forum shows a mismatch in options related to C++20, see: http://forums.codeblocks.org/index.php/topic,24079.0.html

The compiler options related to C++20 in GCC are a bit flawed. Currently they only appear if you have GCC 9 or 10, and always as -std=c++20 or -std=gnu++20. This is correct for GCC 10, but not for 9.

If you look at GCC standards support you can see C++20 is (partially) supported since version 8, and the option is -std=c++2a or -std=gnu++2a for GCC 8 or 9, and -std=c++20 or -std=gnu++20 for GCC = 10.

See: https://gcc.gnu.org/projects/cxx-status.html

The attached patch corrects this dividing the current entry into two, one for GCC 8 or 9 and other for GCC 10.

1 Attachments

Discussion

  • Teodor Petrov

    Teodor Petrov - 2020-12-13

    This one depends on [#1041]

     

    Related

    Tickets: #1041

  • Morten MacFly

    Morten MacFly - 2020-12-17
    • assigned_to: Morten MacFly
     
  • Morten MacFly

    Morten MacFly - 2020-12-17

    I am taking this one... I think I did the C++20 changes so its also my duty to correct them... :-)

     
  • Teodor Petrov

    Teodor Petrov - 2021-03-06

    We have the version check now in trunk, so we could take advantage of it here probably.

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-03-08

    This modified patch uses the new verbs to activate c++2a or c++20 depending on GCC version. Please note (line 64 of the patch) that support for C++20 was introduced in GCC 8, not in GCC 9.

     
  • Teodor Petrov

    Teodor Petrov - 2021-03-16

    @mortenmacfly Are you going to push this patch or should I take it over?

     
  • Morten MacFly

    Morten MacFly - 2021-03-17

    Will do...

     
  • Morten MacFly

    Morten MacFly - 2021-03-17
    • status: open --> applied
    • Milestone: Undefined --> Next_Nightly
     
  • Morten MacFly

    Morten MacFly - 2021-03-17

    Applied in SVN. Thank you!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.