https://bugs.llvm.org/show_bug.cgi?id=46910
Bug ID: 46910
Summary: Deferred Diagnostics still fire if call is constexpr
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Clang Compiler Support
Assignee: unassignedclangb...@nondot.org
Reporter: erich.ke...@intel.com
CC: llvm-bugs@lists.llvm.org
See this example:
https://godbolt.org/z/znj5Pv
constexpr float bar(long double f) { return f;}
void foo() {
#pragma omp target
{
float error = 0.0;
#pragma omp parallel for reduction(max:error)
for (int i = 0; i < 20; ++i) {
constexpr auto x = bar(1.1);
}
}
}
Diagnostic is:
<source>:10:28: error: 'bar' requires 128 bit size 'long double' type support,
but device 'nvptx64-nvidia-cuda' does not support it
constexpr auto x = bar(1.1);
^
<source>:2:17: note: 'bar' defined here
constexpr float bar(long double f) { return f;}
However, the invocation of 'bar' never makes it to the device, since it is
evaluated at compile time. Delayed diagnostics for uses should likely be
relaxed if it is evaluated during constant evaluation.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs