[llvm-bugs] [Bug 52437] New: [C++4OpenCL] Incorrect diagnostic for constant address space variables

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 8 06:32:26 PST 2021


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

            Bug ID: 52437
           Summary: [C++4OpenCL] Incorrect diagnostic for constant address
                    space variables
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anastasia.stulova at arm.com
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

The following test case provides incorrect diagnostic:

struct C2 {
  int m;
  C2(int init) __constant {};
};

kernel void foo(){
    __constant C2 cobj3 = {1};
}

<source>:8:19: error: non-kernel function variable cannot be declared in
constant address space

The same error occurs if we define a correct ctor:

constexpr C2(int init) __constant : m(init) {};

We need to fix this issue and then update the C++ for OpenCL documentation on:
https://github.com/KhronosGroup/OpenCL-Docs/pull/667

-- 
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/20211108/c39d58d6/attachment.html>


More information about the llvm-bugs mailing list