<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 - Function resolution should follow the same rule in global context as function body."
href="https://bugs.llvm.org/show_bug.cgi?id=44266">44266</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Function resolution should follow the same rule in global context as function body.
</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>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>CUDA
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>michael.hliao@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22925" name="attach_22925" title="resolution under function gets the correct host function">attachment 22925</a> <a href="attachment.cgi?id=22925&action=edit" title="resolution under function gets the correct host function">[details]</a></span>
resolution under function gets the correct host function
In the following sample code
```
__device__ float fn(int);
__host__ float fn(float);
float gvar = fn(1);
```
clang failed to find the correct candidate of `fn`. But, if we modify that to
resolve `fn` under a function body. The correct one is used.
```
__device__ float fn(int);
__host__ float fn(float);
float gfunc() {
return fn(1);
}
```
For function resolution in (host-side) global initializers, we should follow
the same rule as the one under a function body.</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>