array in std::tuple passed to std::tuple_cat in decltype error - g++ vs clang++ - which compiler is right

半世苍凉 提交于 2019-12-10 18:13:51

问题


Consider the code below:

#include <tuple>

int main() {
   std::tuple<char[2], int> t1;
   std::tuple<int> t2;
   decltype(std::tuple_cat(t1, t2)) t3;
}

It compiles fine with g++ (in version >= 5.2) and icc (13.0.1), but not in clang++ and older versions of g++ where it gives nasty error:

array initializer must be an initializer list or string literal

My hunch tells me that the code shouldn't compile and clang++ and older versions of g++ are actually right here, but want to take a second opinion.

来源:https://stackoverflow.com/questions/37421194/array-in-stdtuple-passed-to-stdtuple-cat-in-decltype-error-g-vs-clang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!