[llvm-bugs] [Bug 43057] New: Lambdas in OpenCL C++

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 20 01:47:53 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43057

            Bug ID: 43057
           Summary: Lambdas in OpenCL C++
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: drohr at jwdt.org
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190820/781b9654/attachment.html>


More information about the llvm-bugs mailing list