Skip to content

Commit

Permalink
Disable system header for common_type
Browse files Browse the repository at this point in the history
There is an incredible compiler bug reported in nvbug4867473 where the use of system header changes the way some types are instantiated.

Work around it by not marking common_type.h as system header.
  • Loading branch information
miscco committed Sep 26, 2024
1 parent cc01ce7 commit 24f0e5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 8 additions & 7 deletions libcudacxx/include/cuda/std/__type_traits/common_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

#include <cuda/std/detail/__config>

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
// We cannot use system header here because of nvbug4867473
// #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
// # pragma GCC system_header
// #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
// # pragma clang system_header
// #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
// # pragma system_header
// #endif // no system header

#include <cuda/std/__type_traits/decay.h>
#include <cuda/std/__type_traits/is_same.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// constexpr complex(const complex<float>&);
// };

#undef _CCCL_NO_SYSTEM_HEADER

#include <cuda/std/cassert>
#include <cuda/std/complex>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// explicit constexpr complex(const complex<double>&);
// };

#undef _CCCL_NO_SYSTEM_HEADER

#include <cuda/std/cassert>
#include <cuda/std/complex>

Expand Down

0 comments on commit 24f0e5b

Please sign in to comment.