<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [C++4OpenCL] Missing diagnostic for address space qualified template function return types"
href="https://bugs.llvm.org/show_bug.cgi?id=51215">51215</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[C++4OpenCL] Missing diagnostic for address space qualified template function return types
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>OpenCL
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Justas.Janickas@arm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>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: <a href="https://godbolt.org/z/4rj7n859a">https://godbolt.org/z/4rj7n859a</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>