c++ - 从命令行自动应用 Clang 的修复提示

标签 c++ clang

Clang(和 GCC)编译错误可能会附带有关如何修复它们的建议:“Fix-it Hints”。 Clang(或者可能是另一个 LLVM 工具)是否有一个选项可以应用这些提示?我在 https://clang.llvm.org/docs/UsersManual.html 中没有看到一个.显然这样的程序可以使用-fdiagnostics-parseable-fixits编写;这不是我要问的。

最佳答案

是的。

 -fix-only-warnings      Apply fix-it advice only for warnings, not errors
 -fix-what-you-can       Apply fix-it advice even in the presence of unfixable errors
 -fixit-recompile        Apply fix-it changes and recompile
 -fixit-to-temporary     Apply fix-it changes to temporary files
 -fixit=<value>          Apply fix-it advice creating a file with the given suffix
 -fixit                  Apply fix-it advice to the input source

关于c++ - 从命令行自动应用 Clang 的修复提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49748996/

相关文章:

c++ - 检查指向自定义类的指针是否不再存在

c++ - Linux c++ 控制台获取关键状态

c++ - 字符数组,\0

c++ - lldb在clang++编译时无法调试字符串

铛-错误: non-ASM statement in naked function is not supported

c - 优化时,在现代编译器中使用 `register` 关键字是否无用?

c++ - resolve_initial_references 导致 SystemException

c++ - std::vector<const char *> 的赋值效果错误?

c++ - 如何在 OSX 上尝试新的 `<execution>` header ?

c++ - Clang 在哪里存储 int32_t *p 和 int32_t p[10] 之间的差异?