Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

constant value in a constant expression

$
0
0

The following fails with icc but compiles fine with gcc 4.8. Any idea?

>cat foo.cc
#include <cmath>
constexpr float A_1 = std::pow (1.0,2.0);>icpc -v
icpc version 15.0.0 (gcc version 4.8.1 compatibility)>icpc -c -std=c++11 foo.cc
foo.cc(2): error: function call must have a constant value in a constant expression
  constexpr float A_1 = std::pow (1.0,2.0);
                        ^

compilation aborted for foo.cc (code 2)

 


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>