Suppress candidates suggested by GCC

2019-02-17 15:35发布

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.

My question:

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.

1条回答
forever°为你锁心
2楼-- · 2019-02-17 16:18

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

Features:

  • 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.
查看更多
登录 后发表回答