Linux: -fsyntax-only Windows: None Arguments None Default OFF Normal compilation is performed. Description This option tells the compiler to check only for correct syntax. No object file is produced. IDE Equivalent None Alternate Options Linux: None Windows: /Zs Parent topic: Language Optio...
aggregate `test< false> t' has incomplete type and cannot be defined $ g++ -fsyntax-only /tmp/sa.cpp test.cpp: In function `int main()': test.cpp:6: error: aggregate `test< false> t' has incomplete type and cannot be defined所以,是的,-fsyntax-only确实执行模板扩展。
-qsyntaxonly(-fsyntax-only) Edit online Applicable invocations Table 1. Invocations that accept the given options Optionxlc (Compiling C)xlC (Compiling C++)xlclang (Compiling C)xlclang++ (Compiling C++) -qsyntaxonly✓✓✓✓ -fsyntax-only✓✓ ...
void main(void) { long long int i = 0l; printf("This is a non-conforming c program\n"); } 使用gcc pedant.c -o pedant这个命令时,编译器会警告main函数的返回类型无效: $gcc pedant.c -o pedant pedant.c:In function 'main': pedant.c:7 warning:return type of 'main' is not 'int' ...
命令格式:clang -Xclang -ast-print -fsyntax-only main.cc > main-init.cc其中输入文件为main.cc 输出文件为main-init.cc 生成的文件: 代码语言:javascript 复制 main-init.cc template<intN>struct Fib{enum{Value=Fib<N-1>::Value+Fib<N-2>::Value};};template<>struct Fib<20>{enum{Value=Fib<20...