How to hide defaulted template parameters in gcc error messages?

后端 未结 2 2070
小鲜肉
小鲜肉 2021-02-13 18:14

Reading through error messages generated by g++ is often a pain because gcc expand names like

std::ostream

in my code into a much longer form

2条回答
  •  天涯浪人
    2021-02-13 19:10

    I doubt you can right now. A kind of close option is fno-pretty-templates which acts as follows:

    -fno-pretty-templates
    When an error message refers to a specialization of a function template, the compiler normally prints the signature of the template followed by the template arguments and any typedefs or typenames in the signature (e.g. void f(T) [with T = int] rather than void f(int)) so that it's clear which template is involved. When an error message refers to a specialization of a class template, the compiler omits any template arguments that match the default template arguments for that template. If either of these behaviors make it harder to understand the error message rather than easier, you can use -fno-pretty-templates to disable them.

提交回复
热议问题