<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 - Lambdas in OpenCL C++"
   href="https://bugs.llvm.org/show_bug.cgi?id=43057">43057</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Lambdas in OpenCL C++
          </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>drohr@jwdt.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following example fails when compiled by "clang -cl-std=clc++ -o test
test.cl" with the current clang master (commit
e03316caa048bdac650cfe0f61274677fe9b6ee4):

__kernel void foo() {
  auto bar = []() {};
  bar();
}

Error message is:

test.cl:3:3: error: no matching function for call to object of type '(lambda at
test.cl:2:14)'
  bar();
  ^~~
test.cl:2:14: note: candidate function not viable: address space mismatch in
'this' argument ('(lambda at test.cl:2:14)'), parameter type must be 'const
(lambda at test.cl:2:14)'
  auto bar = []() {};
             ^
test.cl:2:14: note: conversion candidate of type 'void (*)()'
1 error generated.


I presume this might be fixable by adding address space qualifiers, but I think
such simple lambdas should deduce the address space automatically.</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>