<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 - [C++4OpenCL] Issues with address-spaced destructors"
   href="https://bugs.llvm.org/show_bug.cgi?id=51890">51890</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[C++4OpenCL] Issues with address-spaced destructors
          </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>Linux
          </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>OpenCL
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>olemarius.strohm@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Here are some test cases that currently give an error in C++ for OpenCL, though
they should likely work.

Currently the simplest test case:
struct S {
    ~S() __global;
    ~S() __private;
};

void k() {
    __private S s;
}

Is incorrect because it uses the global destructor (It always uses the first
destructor that's defined.

This also extends to many other situations, like inheritance:

struct A {
    ~A() __global = delete;
    ~A() __private = default;
};

struct S: public A {
    ~S() __private;
};

void k() {
    __private S s;
}

Here trying to make a private variable fails because it thinks the destructor
of A is
deleted (because the first destructor is deleted), however if you reorder A's
destructors
it works, because it looks at the top one, which is not deleted.

Destructors are used in a lot of places, and address spaces aren't handled for
any of them,
so there are likely many more situations that are incorrect, but these are the
ones I've found specific cases for.</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>