[llvm-bugs] [Bug 50383] New: CUDA compilation fails if <complex> is included

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 18 04:25:31 PDT 2021


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

            Bug ID: 50383
           Summary: CUDA compilation fails if <complex> is included
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: CUDA
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dontbugme at mailinator.com
                CC: llvm-bugs at lists.llvm.org

The file: "/usr/include/c++/11.1.0/complex" contains function named "polar",
which does the following test:

__glibcxx_assert( __rho >= 0 );

which breaks CUDA compilation. Commenting the above line solves the issue. The
error is as follows:

error: __host__ __device__ function '__failed_assertion' cannot overload
__host__ function '__failed_assertion'
      __glibcxx_assert( __rho >= 0 );
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:754:5:
note: expanded from macro '__glibcxx_assert'
    __glibcxx_assert_1(_Condition)        \
    ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:743:13:
note: expanded from macro '__glibcxx_assert_1'
       void __failed_assertion();       \
            ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/atomic_base.h:266:7:
note: previous declaration is here
      __glibcxx_assert(__b != memory_order_consume);
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:754:5:
note: expanded from macro '__glibcxx_assert'
    __glibcxx_assert_1(_Condition)        \
    ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:743:13:
note: expanded from macro '__glibcxx_assert_1'
       void __failed_assertion();       \
            ^

-- 
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/20210518/ae716594/attachment.html>


More information about the llvm-bugs mailing list