[llvm-bugs] [Bug 51215] New: [C++4OpenCL] Missing diagnostic for address space qualified template function return types

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 26 02:05:57 PDT 2021


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

            Bug ID: 51215
           Summary: [C++4OpenCL] Missing diagnostic for address space
                    qualified template function return types
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Justas.Janickas at arm.com
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

When foo is called with address space qualified argument par, the following
code does not display a diagnostic:

template<typename T>
T foo(T *par){
    return *par;
}

void bar(){
    __global int* ptr;
    foo(ptr);
}


However, the function return types should not be address space qualified. As a
comparison, the following code displays an error:

__global int foo(__global int *par){
    return *par;
}

error: return value cannot be qualified with address space


Full example: https://godbolt.org/z/4rj7n859a

-- 
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/20210726/b12ca6cf/attachment-0001.html>


More information about the llvm-bugs mailing list