问题
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:
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.
来源:https://stackoverflow.com/questions/13025773/suppress-candidates-suggested-by-gcc