GCC error with variadic templates: “Sorry, unimplemented: cannot expand 'Identifier…' into a fixed-length argument list”

前端 未结 4 1208
太阳男子
太阳男子 2020-12-05 02:10

While doing variadic template programming in C++11 on GCC, once in a while I get an error that says \"Sorry, unimplemented: cannot expand \'Identifier...\' into a fixed-leng

4条回答
  •  执念已碎
    2020-12-05 02:45

    What version of GCC are you using? According to this GCC status page, GCC 4.4 should support it.

    Testing with GCC 4.4.2, I get similar error.

    The wording of the error message seems to imply that the code should work according the C++0x standard, but that GCC doesn't support it yet. Or perhaps it is a compiler bug?

    This is correct, GCC understands the code but cannot yet spit out GIMPLE for it.

    As for what causes the error, it's the extension of template variable list to another template's list of variables.

提交回复
热议问题