<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 INVALID - std::is_pod weirdly affected by volatile"
   href="https://bugs.llvm.org/show_bug.cgi?id=35076">bug 35076</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;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>richard-llvm@metafoo.co.uk
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - std::is_pod weirdly affected by volatile"
   href="https://bugs.llvm.org/show_bug.cgi?id=35076#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - std::is_pod weirdly affected by volatile"
   href="https://bugs.llvm.org/show_bug.cgi?id=35076">bug 35076</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>Clang's result is correct. "is_pod" determines whether a type is a C++11 POD
type, which means trivial and standard layout. Triviality requires that the
type be trivially-copyable. Trivial copyability requires

"each copy constructor, move constructor, copy assignment operator, and move
assignment operator (15.8, 16.5.3) is either deleted or trivial, [and]
[the class] has at least one non-deleted copy constructor, move constructor,
copy assignment operator, or move assignment operator"

But all of MyTimeDate's copy/move constructors/assignment operators are
deleted, because mytime_t has no copy/move constructor/assignment that can take
a 'volatile mytime_t&' or 'volatile mytime_t&&'.

So the first MyTimeDate is not copyable at all, so it is not
trivially-copyable, so is not trivial, so is not POD. GCC knows that it's not
copyable, but appears to not realize that this means it's not
trivially-copyable.


In the second case, copying the volatile int64_t member within the copy/move
constructor/assignment operator of mytime_t is valid, and MyTimeDate ends up
being trivially copyable and, ultimately, POD.


So this is a GCC bug.</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>