'How to get list of supported standards in Clang?
I found this in MAN:
-std=language
Specify the language standard to compile for.
-ansi
Same as -std=c89.
But where to find the list of all supported standards by my installed compiler?
clang -std=??? test.c
Solution 1:[1]
Just specify any BS standard and clang will print those acceptable like so:
c:\LLVM\bin>clang++.exe -std=blabla main.cpp
error: invalid value 'blabla' in '-std=blabla'
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
;-)
Solution 2:[2]
https://github.com/llvm-mirror/clang/commit/6b15b6d3c1f8274162d5881b05d79aeddd5d6aad
In case user did not provide valid standard name for -std option, available values (with short description) will be reported.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Artur |
| Solution 2 | Jan Korous |
