public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/34105]  New: [4.3 Regression] Confusing error message with missing #include <algorithm>
@ 2007-11-15  8:57 rguenth at gcc dot gnu dot org
  2007-11-15 11:59 ` [Bug libstdc++/34105] " pcarlini at suse dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-15  8:57 UTC (permalink / raw)
  To: gcc-bugs

For

#include <vector>
#include <string>

int main()
{
  std::vector<std::string> x;
  std::string s("hello");
  return std::find(x.begin(), x.end(), s) - x.begin();
}

we now get "interesting" linker errors with trunk:

> g++-4.3 -o t t.C
/tmp/cc3Vq2t8.o: In function `main':
t.C:(.text+0x65): undefined reference to
`__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >
std::find<__gnu_cxx::__normal_iterator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >
>(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >,
__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)'
collect2: ld returned 1 exit status

where it is not exactly obvious that just the #include <algorithm> is missing
here.  With 4.2 and 4.2 at least the program linked fine (I guess algorithm
was pulled in anyway).

Can we improve this situation by not making algorithm half-way available so
we can raise a meaningful error instead?


-- 
           Summary: [4.3 Regression] Confusing error message with missing
                    #include <algorithm>
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34105


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-11-16  9:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15  8:57 [Bug libstdc++/34105] New: [4.3 Regression] Confusing error message with missing #include <algorithm> rguenth at gcc dot gnu dot org
2007-11-15 11:59 ` [Bug libstdc++/34105] " pcarlini at suse dot de
2007-11-15 13:04 ` pcarlini at suse dot de
2007-11-15 13:06 ` pcarlini at suse dot de
2007-11-15 13:09 ` pcarlini at suse dot de
2007-11-15 13:10 ` pcarlini at suse dot de
2007-11-15 18:15 ` pcarlini at suse dot de
2007-11-15 19:05 ` paolo at gcc dot gnu dot org
2007-11-15 19:07 ` pcarlini at suse dot de
2007-11-15 21:54 ` bkoz at gcc dot gnu dot org
2007-11-16  9:45 ` rguenther at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).