public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29417]  New: link fails with debug and anonymous namespace
@ 2006-10-10 16:16 peter at chocky dot org
  2006-10-10 16:17 ` [Bug c++/29417] " peter at chocky dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: peter at chocky dot org @ 2006-10-10 16:16 UTC (permalink / raw)
  To: gcc-bugs

This is with:

gcc (GCC) 4.2.0 20061007 (experimental)

On x86 Debian and under Fedora Core 3.

Using the lamba part of the boost library, the following is seen:


/tmp/ccNdhcXx.o:(.debug_info+0xec9): undefined reference to
`boost::lambda::(anonymous namespace)::free2'
/tmp/ccNdhcXx.o:(.debug_info+0xed8): undefined reference to
`boost::lambda::(anonymous namespace)::free3'
/tmp/ccNdhcXx.o:(.debug_info+0x47f2): undefined reference to
`boost::lambda::(anonymous namespace)::free2'
/tmp/ccNdhcXx.o:(.debug_info+0x4806): undefined reference to
`boost::lambda::(anonymous namespace)::free3'

I don't think the fault is in the boost library.  Here is the code in question:

namespace {

  // These are constants types and need to be initialised
  boost::lambda::placeholder1_type free1 = boost::lambda::placeholder1_type();
  boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type();
  boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type();

  boost::lambda::placeholder1_type& _1 = free1;
  boost::lambda::placeholder2_type& _2 = free2;
  boost::lambda::placeholder3_type& _3 = free3;
  // _1, _2, ... naming scheme by Peter Dimov
} // unnamed

To trigger the problem requires at least -O and -g2.  My C++ isn't good enough
to comment further.  I attach a minimal preprocessed case.  compile with:

g++-4.2 test.ii -O -g2 

This works correctly on previous GCC versions, and with -g1.


-- 
           Summary: link fails with debug and anonymous namespace
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peter at chocky dot org


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


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

end of thread, other threads:[~2006-10-20  7:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10 16:16 [Bug c++/29417] New: link fails with debug and anonymous namespace peter at chocky dot org
2006-10-10 16:17 ` [Bug c++/29417] " peter at chocky dot org
2006-10-10 16:49 ` [Bug c++/29417] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-10-11  1:21 ` pinskia at gcc dot gnu dot org
2006-10-11  2:49 ` pinskia at gcc dot gnu dot org
2006-10-11  2:51 ` pinskia at gcc dot gnu dot org
2006-10-15 21:23 ` mmitchel at gcc dot gnu dot org
2006-10-17 16:26 ` janis at gcc dot gnu dot org
2006-10-20  7:42 ` pinskia at gcc dot gnu dot org

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).