C++ err msgs [ was Re: building libstdc++-v3 from the 20000105snapshot dies with multiple def errors. ]

llewelly@dbritsch.dsl.xmission.com llewelly@dbritsch.dsl.xmission.com
Wed May 10 13:49:00 GMT 2000


On Wed, 10 May 2000, Steven King wrote:

> On Wed, 10 May 2000, Dr. David Gilbert wrote:
> > Hi,
> >   I know this one is probably off topic a bit, but Benjamins mail which
> > included the library build errors reminded me of something.
> > 
> > Is there any way to make the errors which appear after misusing parts of
> > the library (especially some of the template classes) more friendly?  New
> > users run a mile when they get a single error message half a page
> > long.....
> 
> for 2.95, I find it helps to pipe the output through a sed script to collapse
> the template names.  ie
> 
> #!/bin/sed -f
> s/,\([ ]*\)std::allocator<\([^>]*\)>//g
> s/std::basic_string<char,\([ ]*\)std::char_traits<char>\([ ]*\)>/string/g
> s/std::basic_string<wchar_t,\([ ]*\)std::char_traits<wchar_t>\([ ]*\)>/wstring/g
> 
> This wont work for 2.96, but its not needed as much.  (I just 2.96 wouldnt
> prefix each continuation line the file name...)
> 

Many of the std template classes (all of the container classes) have one
  or more default template parameters, which are usually left at their
  defaults, and are seldom important to deciphering the error message.

I would like to see an option to g++ that omit default template parameters
  in typenames that matched the default.

So instead of seeing 

  std::vector<int,std::allocator<int> >

you would see

  std::vector<int>

This would help those of us who use stuff like map<string,vector<int> > on
  a regular basis ...



More information about the Libstdc++ mailing list