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

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

Reply via email to