[Bug c++/19608] New: ICE after friend function definition in local class

amylaar at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jan 24 19:24:00 GMT 2005


bash-2.05b$ cat friend.c
void f ()
{
  class c
    {
      friend void g () { }
    };
}
bash-2.05b$ ./cc1plus friend.c
 void f()

friend.c:5: error: can't define friend function ‘g’ in a local class definition
 void g()

friend.c: At global scope:
friend.c:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
bash-2.05b$ ./cc1plus --version
GNU C++ version 4.0.0 20050124 (experimental) (sh-elf)
        compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-42).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

I gte the same error with an i686-targted compiler from an August snapshot.

-- 
           Summary: ICE after friend function definition in local class
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu


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



More information about the Gcc-bugs mailing list