压制海湾合作委员会建议的候选人 [英] Suppress candidates suggested by GCC

查看:86
本文介绍了压制海湾合作委员会建议的候选人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gcc 4.7.2.我的代码非常注重模板和 boost 的用法.当我进行编译并且定义或使用歧义时,我经常会收到错误消息,提示有两个候选对象,通常在它们单独的在[某深层路径]中包含的文件中:"中定义,并为每个候选对象提供相应的错误消息,以说明原因那个特定的候选人失败了.尤其是使用boost和template时,即使是这样的单个错误也变得完全难以理解.

I'm using gcc 4.7.2. My code is rather heavy on template and boost usage. When I compile and I've defined or used something ambiguous, I often get error messages that suggest two dozen candidates, usually defined in their separate "in file included from [some deep path]:", with corresponding error messages per candidate on why that particular candidate fails. Especially using boost and templates, even a single error like this becomes completely unintelligible.

我的问题:

是否可以控制寻找合适候选人的深度?

Is there an option to control how deep the search for suitable candidates goes?

理想情况下,我希望它关闭 ,或者至少将其减少到仅前一个或两个候选人-其余候选人通常反而毫无用处.

Ideally, I'd like it turned off, or at least reduce it to only the first one or two candidates -- the rest of the candidates is usually pretty useless anyway.

推荐答案

我使用 gccfilter 进行制作模板错误更具可读性.从网站上:

I use gccfilter to make template errors much more readable. From the website:

功能:

  • 诊断消息的颜色(具有可自定义的颜色)
  • 简化模板程序的输出:删除"with"子句,模板参数,
  • 以模板参数的值内联替换模板参数,
  • 删除名称空间,
  • 删除实例化链.
  • coloring of diagnostic messages (with customizable colors),
  • simplification of templated programs output: removal of "with" clauses, template arguments,
  • inline replacement of template arguments by their values,
  • removal of namespaces,
  • removal of instantiation chains.

这篇关于压制海湾合作委员会建议的候选人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆