This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Degraded C++ error messages.
On Nov 8, 2003, at 8:02 PM, Carlo Wood wrote:
When the types that need to be printed are template types, then
it is possible that those types become very large - and for
that we can think of a way to improve that. But that is
not related to the problem at hand imho: a type is a type,
there is little you can change about that. At most you can
think of printing the template parameters seperatedly, and
using standard or user defined typedefs to compress the type
that is printed. Ie, instead of printing
std::basic_string<char, std::char_traits<char>, std::allocator<blah
blah blah...
why not just print 'std::string'? The message need to be
interpreted by humans after all. Same for 'std::vector<UserType>'
EDG has experimented with that. They've found that it's
a hard problem, and not one that has a clean solution:
sometimes what you want is the typedef, sometimes what
you want is the raw type name in all its gory detail.
Again, the problem is that a nontelepathic compiler has
trouble figuring out which case is which.
One option might be for the compiler to give both versions
of the name, on the grounds that users can ignore what
they don't care about. I've also sometimes fantasized
about interactive error messages, but I've never worked
out what that would really mean.
--Matt