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: unassignedclangb...@nondot.org
          Reporter: dontbu...@mailinator.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to