Код: Выделить всё
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-fdiagnostics-color=always",
"-g",
"-std=c++20",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": "build",
"detail": "compiler: /usr/bin/clang++"
}
]
}
Код, который инструктор посоветовал запустить, чтобы проверить, является ли это C++20
Код: Выделить всё
#include
int main(int argc, const char **argv)
{
int result = (10 20) > 0;
return 0;
}
Код: Выделить всё
➜ clang++ main.cpp
main.cpp:10:22: warning: '' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
int result = (10 20) > 0;
^
main.cpp:10:24: error: expected expression
int result = (10 20) > 0;
^
1 warning and 1 error generated.
Подробнее здесь: https://stackoverflow.com/questions/718 ... tasks-json