<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 - [Address space] Missing check for validity of addr space conversions for 'this' parameter"
   href="https://bugs.llvm.org/show_bug.cgi?id=41730">41730</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Address space] Missing check for validity of addr space conversions for 'this' parameter
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anastasia.stulova@arm.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>Currently Clang will accept invalid address space conversion generated
implicitly when passing objects to 'this' parameter.

For example:

struct MyType {
  MyType(int i) : i(i) {}
  int i;
};

MyType __attribute__((address_space(10))) m = 123;

This code should only be allowed if target permits conversions from AS 123 to 0
implicitly. However, we don't support yet target hooks to setup address space
conversions (explained in RFC:
<a href="http://lists.llvm.org/pipermail/cfe-dev/2019-March/061541.html">http://lists.llvm.org/pipermail/cfe-dev/2019-March/061541.html</a>) and therefore
adding such check will prevent using addr spaces in C++.

The solution to that could be addr space method qualifiers that is review:
<a href="https://reviews.llvm.org/D57464">https://reviews.llvm.org/D57464</a>

See original discussion in <a href="https://reviews.llvm.org/D59988">https://reviews.llvm.org/D59988</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>