<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED LATER - Rejects-valid: constexpr and explicit default ctor"
   href="http://llvm.org/bugs/show_bug.cgi?id=17694">bug 17694</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>richard-llvm@metafoo.co.uk
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>LATER
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED LATER - Rejects-valid: constexpr and explicit default ctor"
   href="http://llvm.org/bugs/show_bug.cgi?id=17694#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED LATER - Rejects-valid: constexpr and explicit default ctor"
   href="http://llvm.org/bugs/show_bug.cgi?id=17694">bug 17694</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>It's helpful to provide the diagnostic when reporting that code is rejected.
Here, Clang says:

<stdin>:9:15: error: default initialization of an object of const type 'const
A' requires a user-provided default constructor
  constexpr A a;
              ^

... which is correct. g++ accepts this because it has speculatively implemented
a resolution to this core issue:

  <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253</a>

In Clang, we're waiting for the issue to actually be resolved before we take a
direction on it.


Note that 'constexpr' is entirely irrelevant here; the same thing happens with:

class A
{
public:
  A() = default;
};

int main(int argc, char** argv)
{
  const A a;
}

In either case, g++ also rejects if you add any data member to 'A'.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>