BullseyeCoverage
A compiler error containing the symbol BullseyeCoverageTemplateSyntaxError
occurs,
such as below.
error C2065: 'BullseyeCoverageTemplateSyntaxError' : undeclared identifier
BullseyeCoverage encountered a syntax error in a template definition. Your compiler normally does not parse template definitions unless they are instantiated.
Use the following recommendations to improve the diagnostic readability.
/permissive-
.
-fno-delayed-template-parsing
.
--strict
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.
/permissive-
-fdelayed-template-parsing
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
Copyright © Bullseye Testing Technology. All Rights Reserved.