icpc 14.0 compiler bug (array)

icpc 14.0 compiler bug (array)

Bild des Benutzers Johnny Willemsen

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.

AnhangGröße
Herunterladen icc14bug-2.txt1.16 KB
7 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Johnny Willemsen

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

Bild des Benutzers Sergey Kostrov

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.

Bild des Benutzers Johnny Willemsen

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

Bild des Benutzers QIAOMIN Q. (Intel)

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.

Bild des Benutzers Johnny Willemsen

Yes, formally reported as bug to Intel support.

Bild des Benutzers QIAOMIN Q. (Intel)

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

Melden Sie sich an, um einen Kommentar zu hinterlassen.