<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - __has_trivial_destructor(_Atomic(int)) should be true (and other issues)"
   href="https://bugs.llvm.org/show_bug.cgi?id=41284">41284</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__has_trivial_destructor(_Atomic(int)) should be true (and other issues)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>comexk@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>More generally, using raw _Atomic types rather than the std::atomic<T> wrapper
(e.g. in a -nostdinc context) is less ergonomic than it could be.  

__has_trivial_destructor(_Atomic(int)) returns false, and attempting to
destruct one using a generic wrapper produces an error:

template <typename T>
void destruct(T *t) {
    t->~T();
}

void a(_Atomic(int) *p) { destruct(p); }

->

<source>:3:6: error: object expression of non-scalar type '_Atomic(int)' cannot
be used in a pseudo-destructor expression

Also, although this is probably more effort to implement, Clang can't deduce
the parameter of an _Atomic() type:

template <typename T>
struct X;
template <typename T>
struct X<_Atomic(T)> {};

->
<source>:4:8: error: class template partial specialization contains a template
parameter that cannot be deduced; this partial specialization will never be
used [-Wunusable-partial-specialization]


Since these types are not defined by the C++ standard, there's no normative
answer on whether the current behavior is correct, but I think it would make
more sense if they worked closer to how one would expect.</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>