Go to the first, previous, next, last section, table of contents.


Error Reporting

The C++ front-end uses a call-back mechanism to allow functions to print out reasonable strings for types and functions without putting extra logic in the functions where errors are found. The interface is through the cp_error function (or cp_warning, etc.). The syntax is exactly like that of error, except that a few more conversions are supported:

There is some overlap between these; for instance, any of the node options can be used for printing an identifier (though only %D tries to decipher function names).

For a more verbose message (class foo as opposed to just foo, including the return type for functions), use %#c. To have the line number on the error message indicate the line of the DECL, use cp_error_at and its ilk; to indicate which argument you want, use %+D, or it will default to the first.


Go to the first, previous, next, last section, table of contents.