From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30000 invoked by alias); 15 Nov 2007 08:57:55 -0000 Received: (qmail 29980 invoked by uid 48); 15 Nov 2007 08:57:44 -0000 Date: Thu, 15 Nov 2007 08:57:00 -0000 Subject: [Bug libstdc++/34105] New: [4.3 Regression] Confusing error message with missing #include X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg01351.txt.bz2 For #include #include int main() { std::vector 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::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > > std::find<__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >, std::basic_string, std::allocator > >(__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >, __gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >, std::basic_string, std::allocator > const&)' collect2: ld returned 1 exit status where it is not exactly obvious that just the #include 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 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