OrangeC icon indicating copy to clipboard operation
OrangeC copied to clipboard

Add c++17 support

Open chuggafan opened this issue 7 years ago • 25 comments

This is a request for a "long term goal" of adding c++17 support, with a lot of new features and useful items that would allow one to utilize features such as the "filesystem" library that llvm and Microsoft have, meaning you can use it for file manipulation easily as utilize features such as [[nodiscard]] which gives users a warning that the value returned from a function is usually used, as well as implement new, useful keywords such as byte (which is not a keyword in previous versions of c++) which could be used for explicitly wanting a 8 bit byte, as well as other features, such as nested namespaces, where one can do:


namespace A::B::C {

}

instead of:


namespace A {
    namespace B {
        namespace C {
}}}

This is a LONG TERM GOAL, so I hope it can be implemented eventually, the other thing I would like to ask in this issue is the implementation of feature test macros for components that exist within the compiler, the macros that could be used to detect certain features are given here for showing what values each macro should hold if it exists at all

I'd also like to again, express my thanks for all of the hard work you've done, I am currently still working on that threading testing, but I will also look into attempting to take what you've done with your c11 threading header and convert it to being able to be used for the c++ threading section as well

chuggafan avatar May 20 '18 19:05 chuggafan

yeah I do have a long term goal of implementing C++2017; I had just completed C++2014 last year though and was taking a break lol! But when I looked at the list of features in 2017 it didn't seem too bad given that I can reuse the llvm library for the really hard stuff...

Thank you for your appreciation, it means a lot to me :)

LADSoft avatar May 20 '18 20:05 LADSoft

BTW I was just going to leave the issue about the multithreading support open and see if you would find time for it at some point... it isn't like i don't have a ton of other things to do lol!

LADSoft avatar May 20 '18 22:05 LADSoft

it looks like fold expressions and class template auto deduction are the most difficult things to implement in this version of the standard; everything else should proceed easily enough.

LADSoft avatar Nov 05 '20 14:11 LADSoft

so i've started on c++17 support now; im thinking in terms of trying to get a release with this and C2X support sometime around christmas. It will also be time to bump the compiler to version 7 when we get this done...

LADSoft avatar Sep 24 '23 22:09 LADSoft

the major things left are copy elision and CTAD... there are a couple of minor things as well.

I figure I can get through most of this in a couple of weekends :smile:

LADSoft avatar Oct 05 '23 19:10 LADSoft

I have one more feature to add: lambda capture of *this. It shouldn't be a big deal... after that I'll seriously try compiling some stuff in c++17 mode to see how it handles the libraries....

LADSoft avatar Oct 22 '23 23:10 LADSoft

so im back to working on this - added lambda capture of *this and fixed some bugs with lambda functions. I'm in the process of compiling against the c++17 version of libcpp, have fixed several bugs but right now the issue is that c++14 variable templates don't quite work properly. Hope to have this fixed within the next few days...

after I get this working I will dive into all the recently added items in the backlog/discussions.

LADSoft avatar Nov 25 '23 17:11 LADSoft

so making progress. Over the last few weeks ive rewritten the constexpression handling to handle various use cases that came up with running the lbcxx tests for c++17.... I'm slowly working through the tests. One crashes during compile, A few others still don't compile, a lot of the executables throw asserts when they are run, and I guess a couple of executables are stuck in infinite loops. But there are less than 100 open issues at this point... I'll be working through them over the next few weeks.

Once we get this done I have a few minor things to investigate that may improve the speed of the compiler, and once I'm through that we will release c++17 version.

LADSoft avatar Apr 16 '24 21:04 LADSoft