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

--- Comment #22 from Jörg Richter <joerg.rich...@pdv-fs.de> 2012-09-14 07:58:16 
UTC ---
I have reduced a real live case. But still using <vector>.

$ cat t.cc
#include <vector>
struct ClassicUpdate
{
    ClassicUpdate();
};
typedef std::vector<ClassicUpdate> ClassicUpdates;
struct UpdateData
{
    ClassicUpdates classicUpdates;

    UpdateData( ClassicUpdates const& classicUpdates )
      : classicUpdates( classicUpdates )
    {}
};
int main()
{}

$ g++ -std=gnu++0x -o mm t.cc -save-temps

$ grep Construct.*ClassicUpdate *.s
        .weak   _ZSt10_ConstructI13ClassicUpdateIRKS0_EEvPT_DpOT0_[DS]
  ...

This should demostrate that GCC compiles a symbol referencing ClassicUpdate
into the executable. When the AIX linker decides to use that symbol you get 
an undefined reference error. This is not the case here. But the unreduced 
source has the problem.

GCC 4.6.3 doesn't do this. And removing -std=gnu++0x works too.

So it seems this is not regex-related but a deeper bug in GCC 4.7 that emits 
functions that are never called.

Reply via email to