title: Constexpr variable and division
body: <p>I'm trying to evaluate this simple expression at compile time using C++11 new constexpr feature:</p>
  
  <pre><code>template &lt;int a, int b&gt;
  class Test
  {
     static constexpr double c = a / b;
  };
  </code></pre>
  
  <p>But here's what Clang keeps telling me:</p>
  
  <pre><code>Constexpr variable 'c' must be initialized by a constant expression
  </code></pre>
  
  <p>The weird thing is that the following compiles well:</p>
  
  <pre><code>template &lt;int a, int b&gt;
  class Test
  {
     static constexpr double c = a / 2.f;
  };
  </code></pre>
  
  <p>Do you guys have any idea on why a/b is not a constant expression, and how could I evaluate this at compile time?</p>
  
  <p>Using Clang compiler with -std=c++1y and -stdlib=libc++</p>
  
  <p><B>Update</B></p>
  
  <p>The following example causes the error with the original code:</p>
  
  <pre><code>Test&lt;10,0&gt; test1 ;
  </code></pre>
  
  <p>while:</p>
  
  <pre><code>Test&lt;10,1&gt; test1 ;
  </code></pre>
  
  <p>does not.</p>