title: The value of a const variable is or is not usable in a constant expression, depending on the variable type
body: <p>The following code is fine:</p>
  
  <pre><code>constexpr double square_cstxpr(double x) { return x * x; }
  
  int main() {
      const int test = 5;
      constexpr double result = square_cstxpr((double)test);
  }
  </code></pre>
  
  <p>However, if the type of <code>test</code> is changed from <code>const int</code> to <code>const double</code>, g++ gives the following error: <code>the value of 'test' is not usable in a constant expression</code>.</p>
  
  <p>See the code and output of g++ here: <a href="http://coliru.stacked-crooked.com/a/2fe9b176c2b23798" rel="noreferrer">http://coliru.stacked-crooked.com/a/2fe9b176c2b23798</a></p>
  
  <p>Could somebody explain that behavior?</p>