gcc-trunk (20100115)

    template <typename T> struct toff;

    template <typename TR, typename... TA> struct toff<TR (*)(TA...)> {

        typedef TR type;
    };

    template <typename TR, typename TC, typename... TA> struct toff<TR
(TC::*)(TA...) const> {

        typedef TR type;
    };

    template <typename TR, typename TC, typename... TA> struct toff<TR
(TC::*)(TA...)> {

        typedef TR type;
    };


    template <typename T> void dem(T op) {

        typedef typename toff<decltype(&T::operator ())>::type r_type;
    }


int main(int argc, char *argv[]) {

    dem([](int x){ return x; });
    return 0;
}


$ g++ -std=gnu++0x br.cpp
br.cpp: In function 'void dem(T) [with T = main(int, char**)::<lambda(int)>]':
br.cpp:29:31:   instantiated from here
br.cpp:23:64: internal compiler error: canonical types differ for identical
type
s int(int) and int(int)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: ICE when checking the type of a lambda
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: piotr dot wyderski at gmail dot com
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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

Reply via email to