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

            Bug ID: 44266
           Summary: Function resolution should follow the same rule in
                    global context as function body.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: CUDA
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 22925
  --> https://bugs.llvm.org/attachment.cgi?id=22925&action=edit
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.

-- 
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