通过铿锵的现代化使用来解决冲突

时间:2017-06-09 17:06:30

标签: c++11 clang-format clang-static-analyzer

我在整个CMake项目中通过run-clang-tidy-3.9.py脚本使用clang-tidy中的modernize-use-using检查器(我使用cmake生成的compile_commands.json文件)。

这适用于其他现代化的检查器(auto,for循环,覆盖等),但是现代化使用检查器发现“冲突”,例如:

    There are conflicting changes to /home/OTB/git/otb/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h:

The following changes conflict:

Replace 48:3-48:84 with "using RealType = typename itk::NumericTraits<typename TInput::ValueType>::RealType"

Replace 48:3-48:84 with "using RealType = typename itk::NumericTraits<typename VariableLengthVector<double>::ValueType>::RealType"

Replace 48:3-48:84 with "using RealType = typename itk::NumericTraits<typename VariableLengthVector<float>::ValueType>::RealType"

查看源代码,我不明白为什么会出现这样的冲突,但问题是因为这些,我的项目没有应用其他修复。这些与修复数量相关的冲突非常少,但是我找不到强制铿锵地应用其余部分的方法。

clang-tidy工具在单独运行时有-fix-errors选项,但这不适用于使用CMake命令文件的run-clang-tidy脚本。

任何建议都将不胜感激。

由于

0 个答案:

没有答案