Degraded C++ error messages.

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Nov 9 05:06:00 GMT 2003


Carlo Wood <carlo@alinoe.com> writes:

| For example;  suppose we have the following code:
| 
| 
|   x = y + z - r;  g = h - k * i;
| 
| Type of problem occuring: a binary expression for two types 
| is requested that does not exist.
| Information need: "No such function (alternatives: ..."
|                   "Name of binary expression"
| 		  "Very short reference to the two elements
| 		   involved."
| For example:
| error: No such function: operator-(std::string&, float&) in `h - k * i'

This supposes std::string& and float& accurately captures the operands
and the type of the operator (which is assumed here to be non-member).

  No matching function 'operator-' in 'h - k + i' for operands 'h' ofr
  type "..." and 'k * i' of type.

It is tempting to describe C++ expressions in terms of types; it might
work in small.  It does not  scale behond trivial cases, and shows up
in diagnostics in interesting cases.

-- Gaby



More information about the Libstdc++ mailing list