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]

[Bug c++/16929] New: ICE on taking address of member in default parameter to member function


Compiling the following tiny C++ code sample causes gcc-3.4.1 to crash:

-----------------------------------------------------
template <class T>
class A {
    int x;
};

template <class T>
class B {
protected:
    
    A<T> a;
    
    void f(const A<T> * a1 = &a);
    
    void g(void);
};

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

template class B<long>;
----------------------------------------------

Result when compiled:

bug.cxx: In instantiation of `void B<T>::g() [with T = long int]':
bug.cxx:23:   instantiated from here
bug.cxx:20: internal compiler error: Segmentation fault
Please submit a full bug report, 

I guess that the default parameter usage may be invalid code, but of course the
compiler shouldn't crash...

-- 
           Summary: ICE on taking address of member in default parameter to
                    member function
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: niemayer at isg dot de
                CC: gcc-bugs at gcc dot gnu dot org
 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=16929


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