[llvm-bugs] [Bug 46910] New: Deferred Diagnostics still fire if call is constexpr

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 30 06:36:25 PDT 2020


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: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200730/2f0f6939/attachment.html>


More information about the llvm-bugs mailing list