Bug 448390

Summary: g++ link error with -frepo
Product: [Fedora] Fedora Reporter: Serge Pavlovsky <pal666>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-29 10:59:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Serge Pavlovsky 2008-05-26 12:40:50 UTC
Description of problem:

[15:29:11 pal@localhost ~/tmp/bug]$ cat a.cpp
#include <string>
#include <ext/mt_allocator.h>

//workaround:
//template class std :: basic_string < char, std :: char_traits < char >,
__gnu_cxx :: __mt_alloc < char > >;

int main ( ) {
	std :: basic_string < char, std :: char_traits < char >, __gnu_cxx ::
__mt_alloc < char > > s;
	s.push_back ( 'a' );
}

[15:34:12 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp -frepo && LC_ALL=C g++
-o a a.o -frepo
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
a.o: In function `std::basic_string<char, std::char_traits<char>,
__gnu_cxx::__mt_alloc<char, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool,
true> > >::_Rep::_M_set_length_and_sharable(unsigned long)':
a.cpp:(.text+0x28b): undefined reference to `std::basic_string<char,
std::char_traits<char>, __gnu_cxx::__mt_alloc<char,
__gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> > >::_Rep::_S_terminal'
collect2: ld returned 1 exit status

[15:34:15 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp && LC_ALL=C g++ -o a a.o
[15:35:10 pal@localhost ~/tmp/bug]$ 

Version-Release number of selected component (if applicable):

[15:35:10 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ --version
g++ (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How reproducible:

compile with -frepo .push_back() on basic_string with different allocator

Actual results:
link error

Expected results:
successful link

Additional info:
uncommenting workaround works but it defeats purpose of -frepo