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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to