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++/38950] New: ICE: deducing function template arguments for array type.


The following snippet makes GCC 4.3.2 (and SVN versions as of 09/2008 still)
cause an ICE:

template <typename T, T N> void f(T(&)[N]);

int main() {
    int x[2];
    unsigned int y[2];
    f(x); // works
    f(y); // ICE
}

Getting this output:

test.cpp: In function 'int main()':
test.cpp:7: internal compiler error: in dependent_type_p, at cp/pt.c:15585

More information about this issue:
http://stackoverflow.com/questions/472530/how-to-pass-an-array-size-as-a-template-with-template-type


-- 
           Summary: ICE: deducing function template arguments for array
                    type.
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schaub-johannes at web dot de
 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=38950


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