BullseyeCoverage Up Contents Search

Error on "BullseyeCoverageTemplateSyntaxError"

SYMPTOMS

A compiler error containing the symbol BullseyeCoverageTemplateSyntaxError occurs, such as below.

error C2065: 'BullseyeCoverageTemplateSyntaxError' : undeclared identifier

CAUSE

BullseyeCoverage encountered a syntax error in a template definition. Your compiler normally does not parse template definitions unless they are instantiated.

RESOLUTION

Use the following recommendations to improve the diagnostic readability.

MORE INFORMATION

The compilers listed below defer syntax checking of templates until instantiation. BullseyeCoverage cannot determine whether individual templates are instantiated. In order to follow the behavior of these compilers, BullseyeCoverage handles a syntax error in a template by inserting the undefined identifier BullseyeCoverageTemplateSyntaxError into the template. If the template is instantiated, an error is guaranteed to occur, ensuring that errors only occur when the compiler instantiates a template containing an error.

These compilers defer syntax checking of template functions until instantiation.

You can demonstration the compiler behavior with the source code below. The source contains an error that is not reported. Uncomment the first line in main to see the error reported.

template<typename T>
void f()
{
    error
}

int main()
{
    //f<int>();
    return 0;
}

Updated: 1 Mar 2023