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]
Other format: [Raw text]

Re: c++/8591: g++ crashes while instantiating templates


Synopsis: g++ crashes while instantiating templates

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Nov 15 08:52:05 2002
State-Changed-Why:
    Confirmed. A reduced testcase is
    -------------------------------------
    namespace NS {
      template <class T1, class T2, class T3 = int, class T4 = int>
      struct C {};
    }
    
    template <class T> class X {
        friend class NS::C;
    };
    
    X<int> c;
    ----------------------------------
    I get a segfault:
    tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/g++ -c x.cc
    x.cc: In instantiation of `X<int>':
    x.cc:10:   instantiated from here
    x.cc:6: internal compiler error: Speicherzugriffsfehler
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    This is for all versions of gcc, including present CVS.
    
    My list of similar reports (friends and templates and/or 
    namespaces) includes PRs 8355, 8280, 8099, 53, 641, 765, 
    1016, 6256. The last one may be the closest.
    
    By the way, the code is illegal, since you have to declare
    the friend as
      template <...> friend class NS::C;
    Fixing this makes the ICE go away.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8591


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