草庐IT

clang_analyzer

全部标签

c++ - 不明确的成员访问表达式 : is Clang rejecting valid code?

我有一些代码,就这个问题而言,归结为templateclassTemplateClass:publicT{public:voidmethod(){}templatestaticvoidstatic_method(Uu){u.TemplateClass::method();}};classEmptyClass{};intmain(){TemplateClass>c;TemplateClass::static_method(c);}我尝试使用两个编译器的多个版本来编译它。GCC4.2、4.4、4.6毫无怨言地接受它。截至11月14日的Clang2.9和SVN主干拒绝它并显示以下错误消息:e

c++ - 如何为 Visual Studio Clang-Format 插件提供 clang 格式文件?

所以我downloaded,installed,andinsertedintopaththeclangformattingplugin.我还对其进行了测试,它适用于开箱即用的Google(Mozilla等)格式选项,但我无法让它与我的.clang-format文件一起使用。(我已将文件与源文件放在同一个文件夹中,将其编码更改为UTF-8,还尝试将其放入clang安装文件夹,将文件添加到项目中,将其内容写入'{key:value}'但格式化不会发生)。那么如何将格式化文件提供给chrome-format扩展?我的文件内容:{BasedOnStyle:"LLVM",IndentWidth:

c++ - 如何为 Visual Studio Clang-Format 插件提供 clang 格式文件?

所以我downloaded,installed,andinsertedintopaththeclangformattingplugin.我还对其进行了测试,它适用于开箱即用的Google(Mozilla等)格式选项,但我无法让它与我的.clang-format文件一起使用。(我已将文件与源文件放在同一个文件夹中,将其编码更改为UTF-8,还尝试将其放入clang安装文件夹,将文件添加到项目中,将其内容写入'{key:value}'但格式化不会发生)。那么如何将格式化文件提供给chrome-format扩展?我的文件内容:{BasedOnStyle:"LLVM",IndentWidth:

c++ - Windows 上的 Clang

首先,我关注了"GettingStarted:BuildingandRunningClang".特别是,我根据“使用VisualStudio”部分构建了它。换句话说,我是使用VisualStudio2010构建的。其次,我手动设置了MinGW分发的包含和库路径:我正在尝试编译的简单程序:#includeusingnamespacestd;intmain(){cout我从编译器得到以下反馈:InfileincludedfromC:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\iostream:39:InfileincludedfromC:\MinGW\

c++ - Windows 上的 Clang

首先,我关注了"GettingStarted:BuildingandRunningClang".特别是,我根据“使用VisualStudio”部分构建了它。换句话说,我是使用VisualStudio2010构建的。其次,我手动设置了MinGW分发的包含和库路径:我正在尝试编译的简单程序:#includeusingnamespacestd;intmain(){cout我从编译器得到以下反馈:InfileincludedfromC:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\iostream:39:InfileincludedfromC:\MinGW\

c++ - clang 似乎使用 gcc 库

这是我第一次使用clang。我注意到,clang引用std库的任何错误如下所示:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:245:7:^^^^^^^^^所以它看起来像clang链接——或者至少包括——gcc库。我使用的命令:clang++-c-Wall-Wextra-Werror-gtest.cpp-otest.o。(为了证明这一点,程序故意犯了错误)。这怎么可能?我该怎么做才能让clang使用它自己的库(但不破坏gcc)?附加信息:我在Ubuntu14.04机器上。clan

c++ - clang 似乎使用 gcc 库

这是我第一次使用clang。我注意到,clang引用std库的任何错误如下所示:/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ostream:245:7:^^^^^^^^^所以它看起来像clang链接——或者至少包括——gcc库。我使用的命令:clang++-c-Wall-Wextra-Werror-gtest.cpp-otest.o。(为了证明这一点,程序故意犯了错误)。这怎么可能?我该怎么做才能让clang使用它自己的库(但不破坏gcc)?附加信息:我在Ubuntu14.04机器上。clan

python - clang : error: : errorunsupported option '-fopenmp' on Mac OSX El Capitan building XGBoost

我正在尝试构建XGBoosttheseinstructions之后的Python包:HereisthecompletesolutiontouseOpenMP-enabledcompilerstoinstallXGBoost.Obtaingcc-5.x.xwithopenmpsupportbybrewinstallgcc--without-multilib.(brewisthedefactostandardofapt-getonOSX.SoinstallingHPCseparatelyisnotrecommended,butitshouldwork.):gitclone--recursi

python - clang : error: : errorunsupported option '-fopenmp' on Mac OSX El Capitan building XGBoost

我正在尝试构建XGBoosttheseinstructions之后的Python包:HereisthecompletesolutiontouseOpenMP-enabledcompilerstoinstallXGBoost.Obtaingcc-5.x.xwithopenmpsupportbybrewinstallgcc--without-multilib.(brewisthedefactostandardofapt-getonOSX.SoinstallingHPCseparatelyisnotrecommended,butitshouldwork.):gitclone--recursi

【C++】Clang-Format:代码自动格式化(看这一篇就够了)

文章目录Clang-format格式化C代码1.引言&安装1.1引言1.2安装2.配置字解释2.1language编程语言2.2BaseOnStyle基础风格2.3AccessModifierOffset访问性修饰符偏移2.4AlignAfterOpenBracket开括号后的对齐2.5AlignArrayOfStructures对齐结构体数组2.6AlignConsecutiveAssignments对齐连续赋值2.7AlignConsecutiveBitFields位段对齐2.8AlignConsecutiveDeclarations连续声明对齐2.9AlignConsecutiveMac