verbosity of compiler

Jonathan Wakely jwakely.gcc@gmail.com
Wed Nov 23 12:02:00 GMT 2016


On 23 November 2016 at 06:37, Leseratte wrote:
> Hello,
>
> I'm stuck in template developing and I would like to know, whether the
> verbosity of compiler output could be increased?
> Especially the decisions made, that lead to certain error?
>
> I'm quite sure, that I made some mistakes, but I don't know, how to get rid of
> them.
>
> One error message for example is this:
>                 error: expected primary-expression before ')' token
>      TimerType::startTimer<mode, ps> ( );
>
> and another looks like
>         error: no match for 'operator<' (operand types are '<unresolved
> overloaded function type>' and 'hal::timer::TimerMode')
>      TimerType::startTimer<mode, ps> ( );
>
> Its the same source line which results in different error messages.
> I would like to know:
> - why is the function unresolved?


That error means you used a name which does not refer to a single
function. It refers to a set of overloaded functions, or a function
template that you didn't specify the template arguments for.

In this case it can't resolve "startTimer" because you didn't tell the
compiler that it's a dependent template:

    TimerType::template startTimer<mode, ps> ();


See https://womble.decadent.org.uk/c++/template-faq.html#disambiguation


> How can I find out, which of my definitions where accepted by the compiler and
> which are rejected?
> Is there somewhat like a debugging mode or verbose mode - that outputs the
> different compiler steps?

Sort of, but it wouldn't help you here. Compilation failed very early
on while parsing the source code. If compilations stops because the
code is invalid then there's nothing much that it can show you,
because it didn't even start compiling the code.



More information about the Gcc-help mailing list