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++/17524] New: ICE with initializing a variable of type void


Spinoff from PR 17344: 
---------------------------------- 
template <typename T> struct intTraits { 
    static const T i = 0; 
}; 
 
struct S { 
    S(intTraits<void>); 
}; 
 
template <typename> struct A {}; 
 
int bar(S); 
int bar(A<int>); 
 
S *s; 
int i = bar(*s); 
------------------------ 
 
We shouldn't ICE here: 
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc 
x.cc: In instantiation of `intTraits<void>': 
x.cc:15:   instantiated from here 
x.cc:2: error: instantiation of `intTraits<void>::i' as type `const void' 
x.cc:2: error: `intTraits<void>::i' has incomplete type 
x.cc:2: error: invalid in-class initialization of static data member of 
non-integral type `<type error>' 
x.cc:1: internal compiler error: tree check: expected class 't', have 
'x' (error_mark) in finish_struct_1, at cp/class.c:5065 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W.

-- 
           Summary: ICE with initializing a variable of type void
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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