Variable Help Question

Pages: 12
It looks like your clang version is 10. To get what C++20 features are currently available use -std=c++20 instead of -std=c++2a.
https://clang.llvm.org/cxx_status.html

An IDE is both a blessing and a curse. Great for "one stop" writing/testing/debugging code. Not so great because it has less flexibility for managing through-put compared to command-line compiling. Six one way, half a dozen another.

As a programming hobbyist I never really got used to mashing on code other than via an IDE.

For years I used C++Builder and Delphi, which really insulates the programmer from the bare metal of coding.
I tried -std=c++20, but it didn't work. I got this message:

error: invalid value 'c++20' in '-std=c++20'
note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard
note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU
      extensions' standard
note: use 'c++11' for 'ISO C++ 2011 with amendments' standard
note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions'
      standard
note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions'
      standard
note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions'
      standard
note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions'
      standard
I guess you are "stuck" using -std=c++2a and -std=gnu++2a then until clang LLVM adds more C++20 features.

Same with every other compiler available no matter what the OS. None are 100% compliant yet.
What parts of C++20 are implemented by which compilers are summarised at

https://en.cppreference.com/w/cpp/compiler_support
Thanks! That helped a lot! Now I know not to use the stuff that clang doesn't support yet.
Topic archived. No new replies allowed.
Pages: 12