{ }}
{} 在-std=c++17 -Wall -pedantic编译的gccvariable 'task' set but not used [-Wunused-but-set-variable]
4 | auto task = [&]() { ++x; }; 但在较新的gcc同样,使用clang时,不会出现这样的警告。 在godbolt上测
下面是代码:在上,GCC10.1和Clang 10 (连同-Wall -Wextra -pedantic-errors -std=c++20)都拒绝编译。GCC:error: ISO C++ forbids declaration of 'main' with no type [-Wpedantic]但是在我的本地机器
(我发现一些东西表明没有,但它们都在3岁左右,从那时起,llvm/clang已经走过了很长一段路。)通过全新安装,我尝试了(downloaded, built, installed llvm/cfe(clang)/compiler-rt/libcxx/libcxxabi from svn)added to /etc