[llvm-bugs] [Bug 44788] New: Function pointer in template argument

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 5 01:28:52 PST 2020


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

            Bug ID: 44788
           Summary: Function pointer in template argument
           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

Created attachment 23092
  --> https://bugs.llvm.org/attachment.cgi?id=23092&action=edit
Testcase

The attached testcase fails compilation with C++ for OpenCL

Compile command: clang++ -cl-std=clc++ -x cl -emit-llvm
--target=spir64-unknown-unknown -O3 -c test.cl -o test.bc

Clang version: latest master, commit 12fe9b26ec88bb2dd40d574a644edca302e804b2

Error message:
clang-10: warning: Unknown CUDA version 10.2. Assuming the latest supported
version 10.1 [-Wunknown-cuda-version]
test.cl:11:10: error: taking address of function is not allowed
    test(foo);
         ^
1 error generated.

The OpenCL C++ spec says: function pointers ... [are not supported by OpenCL
C++] unless they are a compile-time constant expression.
I am not sure about clang C++ for OpenCL, but I think this would be an
interesting feature to support for using modern C++.

-- 
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/20200205/5f568064/attachment.html>


More information about the llvm-bugs mailing list