<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 - [OpenCL C++] Address-space breaks returning struct-type from a function:"
   href="https://bugs.llvm.org/show_bug.cgi?id=38614">38614</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[OpenCL C++] Address-space breaks returning struct-type from a function:
          </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>Windows NT
          </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>erich.keane@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Simplified from the C standard library:

<a href="https://godbolt.org/g/8fdWKq">https://godbolt.org/g/8fdWKq</a>

struct llvmdiv_t {};

llvmdiv_t f1(){
    return llvmdiv_t{};
}

llvmdiv_t f2(){
    llvmdiv_t q;
    return q;
}

<source>:4:12: error: no matching constructor for initialization of 'llvmdiv_t'

    return llvmdiv_t{};

           ^~~~~~~~~~~

<source>:1:8: note: candidate constructor (the implicit copy constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'const llvmdiv_t &'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit move constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'llvmdiv_t &&'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit default constructor)
not viable: requires 0 arguments, but 1 was provided

<source>:9:12: error: no matching constructor for initialization of 'llvmdiv_t'

    return q;

           ^

<source>:1:8: note: candidate constructor (the implicit copy constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'const llvmdiv_t &'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit move constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'llvmdiv_t &&'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit default constructor)
not viable: requires 0 arguments, but 1 was provided

2 errors generated.

Compiler returned: 1</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>