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++/9338: ICE in peculiar templated constructors


Synopsis: ICE in peculiar templated constructors

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 16 07:12:02 2003
State-Changed-Why:
    Confirmed. A smaller testcase is this:
    -------------------------
    struct Bool {
        template <bool> struct CC { typedef int Int; };
    
        template <typename> struct S1 { enum { value = true }; };
        template <typename> struct S2 { enum { value = false }; };
    
        template <typename T>
        Bool (T x, typename CC<S1<T>::value>::Int = 0);
    
        template <typename T>
        Bool (T x, typename CC<!S2<T>::value>::Int = 0);
    };
    
    int main () {
      Bool b (1);
    }
    --------------------------------------
    Note that the second type of the two overloads of the
    constructor resolve to the same type, int.
    
    This code crashes gcc since at least 2.95:
    g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
    x.cc: In function `int main()':
    x.cc:15: internal compiler error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    W.

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


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