If I compile the two files below, where the interface/implementation
relationship is based on an explicitly-given name rather than the basename of
the files, then no implementation appears to be produced.

This occurs on both the 4.0 branch and trunk, and is a regression against
3.4.5.


With 3.3.6:
$ g++-3.3 -c -Wall -pedantic pragii2.cc && nm -A pragii2.o
pragii2.o:00000000 W _ZN1AC1Ev
pragii2.o:00000000 W _ZN1AC2Ev

With 3.4.5:
$ g++-3.4 -c -Wall -pedantic pragii2.cc && nm -A pragii2.o
pragii2.o:00000000 W _ZN1AC1Ev
pragii2.o:00000000 W _ZN1AC2Ev

With recent 4.0 branch:

$ /opt/gcc-svn/gcc-4_0-branch/bin/g++ -c -Wall -pedantic pragii2.cc && nm -A
pragii2.o
[no output]

With recent trunk:
$ /opt/gcc-svn/trunk/bin/g++ -c -Wall -pedantic pragii2.cc && nm -A pragii2.o
[no output]


///////////
// pragii.h
#pragma interface "pragii-imaginary.h"

struct A
{
        A() { }
};
///////////


/////////////
// pragii2.cc
#pragma implementation "pragii-imaginary.h"
#include "pragii.h"
/////////////



Failing compiler versions:

$ /opt/gcc-svn/gcc-4_0-branch/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4_0-branch/configure
--prefix=/opt/gcc-svn/gcc-4_0-branch --enable-threads --disable-libgcj
--enable-languages=c,c++
Thread model: posix
gcc version 4.0.3 20060209 (prerelease)

$ /opt/gcc-svn/trunk/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../trunk/configure --prefix=/opt/gcc-svn/trunk
--enable-threads
Thread model: posix
gcc version 4.2.0 20060203 (experimental)


-- 
           Summary: pragma interface no longer handles explicit names
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zak at transversal dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to