This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error for friend of template


Hello,
I got an internal compiler error when I tried to declare
a member function of a non-templated class as friend of
a template.

Attached are the script of the error (bug.script), the
source (bug.cxx) and the pre-compiled source (bug.ii).

Detlef
$ g++ -v --save-temps -c bug.cxx
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ bug.cxx bug.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../i586-pc-linux-gnu/include
 /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cc1plus bug.ii -quiet -dumpbase bug.cc -version -o bug.s
GNU C++ version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
bug.cxx: In instantiation of `B<char>':
bug.cxx:15:   instantiated from here
bug.cxx:4: Internal compiler error.
bug.cxx:4: Please submit a full bug report.
bug.cxx:4: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
class A
{
public:
  void f();
};

template <class T>
class B
{
  friend void A::f();
public:
  void g();
};

B <char> dc;
# 1 "bug.cxx"
class A
{
public:
  void f();
};

template <class T>
class B
{
  friend void A::f();
public:
  void g();
};

B <char> dc;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]