icpc 14.0 compiler bug (array)

icpc 14.0 compiler bug (array)

Another compiler bug in icpc 14, reporting here because I can't access premier

[build@fc19jslave09 ~]$ cat u.cpp
#include <array>
#include <string>

std::array<std::string, 2> priority_names =
{
  {
     std::string("NOT USED"),
     "P_PANIC"
  }
};

std::string t (uint32_t prop)
{
   uint32_t log = 0;

    for (; prop > 1; ++log)
      prop >>= 1;

    return priority_names[log];
  }

[build@fc19jslave09 ~]$ g++ -std=c++11 -c u.cpp
[build@fc19jslave09 ~]$ icpc -std=c++0x -c u.cpp
/usr/include/c++/4.8.1/array(162): error: a constexpr member function is only permitted in a literal class type
        size() const noexcept { return _Nm; }
        ^
          detected during instantiation of class "std::array<_Tp, _Nm> [with _Tp=std::string, _Nm=2UL]" at line 4 of "u.cpp"

compilation aborted for u.cpp (code 2)
[build@fc19jslave09 ~]$ icpc --version
icpc (ICC) 14.0.0 20130728
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

[build@fc19jslave09 ~]$ g++ --version
g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

附件尺寸
下载 icc14bug-2.txt1.16 KB
7 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

This was done on a Fedora 19 system, that ships with GCC 4.8.1 as compiler out of the box

The thread's title looks the same as your another thread ( icpc 14.0 compiler bug / without ( array ) ) but I see now that the problem is different.

Yes, 2 blocking issues I reproduced in a few minutes after trying the recent release on our TAOX11 product.

I think if you try to compile the testcase such as

'#include <array>
struct A { A(int); };
const std::array<A, 4> x = {{ 1, 1, 1, 1 }};'

would also get the 'error: a constexpr member function is only permitted in a literal class type' ,need a bug report then.

Yes, formally reported as bug to Intel support.

Hello John,

This is a GUN compatability issue and will be fixed in the 14.0 update1.Thanks for your issue submission.

Regards,

--
QIAOMIN.Q
Intel Developer Support

发表评论

登录添加评论。还不是成员?立即加入