title: MSVC brace initialization with doubles appears to violate the standard?
body: <p>Check out this simple program:</p>
  
  <pre><code>int main() {
      float f2 = 7.2; // OK, with warning
      float f3 = 7.199999809265137; // OK, no warning
      float f4{ 7.2 }; // Fails
      float f5{ 7.199999809265137 }; // OK, no warning
      float f6 = { 7.2 }; // Fails
      float f7 = { 7.199999809265137 }; // OK, no warning
  }
  </code></pre>
  
  <p>When compiled with MSVC 2015 using the default options (<code>cl /W4</code>, version 19.00.23918), I get the following messages:</p>
  
  <pre><code>FloatTest.cpp(2): warning C4305: 'initializing': truncation from 'double' to 'float'
  FloatTest.cpp(4): error C2397: conversion from 'double' to 'float' requires a narrowing conversion
  FloatTest.cpp(4): warning C4305: 'initializing': truncation from 'double' to 'float'
  FloatTest.cpp(6): error C2397: conversion from 'double' to 'float' requires a narrowing conversion
  FloatTest.cpp(6): warning C4305: 'initializing': truncation from 'double' to 'float'
  </code></pre>
  
  <p>This program compiles fine with Clang 3.0-3.8 and GCC 4.5.4-6.1.0 (tested with <a href="http://melpon.org/wandbox">http://melpon.org/wandbox</a>), with only warnings for unused variables. Further, removing/commenting out lines <code>f4</code> and <code>f6</code> result in successful compilation (with only the one warning for line <code>f2</code>).</p>
  
  <p>Initially it looks like MSVC is just telling me that 7.2 can't be represented precisely as a <code>float</code>, so it's a narrowing conversion (which is illegal in brace initialization). However, the standard (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf">draft N3337</a>), section 8.5.4, note 7, says this:</p>
  
  <blockquote>
    <p>A <em>narrowing conversion</em> is an implicit conversion...</p>
    
    <ul>
    <li>from <code>long double</code> to <code>double</code> or <code>float</code>, or from <code>double</code> to <code>float</code>, except where the source is a constant expression and the actual value after conversion is within the range of values that can be represented (<strong>even if it cannot be represented exactly</strong>)</li>
    </ul>
  </blockquote>
  
  <p>Emphasis mine. Since 7.2 is within the range of values representable by <code>float</code>, its conversion to <code>float</code> should not be a narrowing conversion according to the standard. Is MSVC in the wrong here, and should I file a bug?</p>