[Bug c++/48531] New: [C++0x][SFINAE] Hard errors with arrays of unknown bound

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Sat Apr 9 17:09:00 GMT 2011


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

           Summary: [C++0x][SFINAE] Hard errors with arrays of unknown
                    bound
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@redhat.com


The following program should be well-formed, but is not:

template<class T,
  class = decltype(T())
>
char f(int);

template<class>
char (&f(...))[2];

static_assert(sizeof(f<int[]>(0)) != 1, "Error"); 

"cannot value-initialize array of unknown bound ‘int []’"



More information about the Gcc-bugs mailing list