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]

c++/2021: Internal error #378.



>Number:         2021
>Category:       c++
>Synopsis:       Internal error #378.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 18 16:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     carlo@alinoe.com
>Release:        gcc version 2.97 20010207 (experimental)
>Organization:
>Environment:
linux
>Description:
Internal error #378 on illegal code, see "How to repeat".
>How-To-Repeat:
Compile the following code snippet:

namespace N {
  class A;
  enum A::e;
}
 
void foo(int);
void foo(N::A::e);
 
namespace N {
  class A {
  public:
    enum e { x };
    friend void foo(void);
    friend void ::foo(int);
    friend void ::foo(e);
  };
}

Result:

>Fix:
Well, that the problem :/ ... I don't know how to do this;
its a catch 21 situation: How can I declare a friend
function in global scope inside N::A when it takes as
parameter N::A::e?  I looked in the standard and it seems
that gcc is doing it correctly, so this is a bug in the
standard imho.

>Release-Note:
>Audit-Trail:
>Unformatted:
 >g++-cvs -c 20010218.cc -v
 Reading specs from /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
 Configured with: /usr/src/gcc/gcc-cvs/configure --prefix=/usr/local/gcc --enable-shared --with-gnu-as --with-gnu-ld --enable-languages=c++
 gcc version 2.97 20010207 (experimental)
  /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1plus -v -iprefix /usr/local/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.97/ -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__l inux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ 20010218.cc -D__GNUG__=2 -D_GNU_SOURCE -D__GXX_ABI_VERSION=100 -quiet -dumpbase 20010218.cc -version -o /tmp/ccR3Olj8.s
 GNU CPP version 2.97 20010207 (experimental) (cpplib) (i386 Linux/ELF)
 GNU CPP version 2.97 20010207 (experimental) (cpplib) (i386 Linux/ELF)
 GNU C++ version 2.97 20010207 (experimental) (i686-pc-linux-gnu)
         compiled by GNU C version 2.97 20010207 (experimental).
 ignoring nonexistent directory "/usr/local/include/g++-v3"
 ignoring nonexistent directory "/usr/local/include/g++-v3/i686-pc-linux-gnu"
 ignoring nonexistent directory "/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include"
 ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/local/gcc/include/g++-v3
  /usr/local/gcc/include/g++-v3/i686-pc-linux-gnu
  /usr/local/include
  /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
  /usr/local/gcc/i686-pc-linux-gnu/include
  /usr/include
 End of search list.
 20010218.cc:3: parse error before `;' token
 20010218.cc:7: incomplete type `N::A' does not have member `e'
 20010218.cc:7: variable or field `foo' declared void
 20010218.cc:7: `int foo' redeclared as different kind of symbol
 20010218.cc:6: previous declaration of `void foo(int)'
 20010218.cc:14: `void foo(int)' should have been declared inside `::'
 20010218.cc:7: previous non-function declaration `int foo'
 20010218.cc:14: conflicts with function declaration `void foo(int)'
 20010218.cc:14: Internal error #378.
 confused by earlier errors, bailing out


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