Closed ax3l closed 4 years ago
Cross-link Nvidia Bug report: 2767419 Update: Confirmed by Nvidia to be fixed for the next CUDA release (latest CUDA release today: 10.2.89).
The problem is likely in detail::all
which uses a constexpr
for
/if
...
Passing --expt-relaxed-constexpr
to nvcc
does not solve the problem either.
It compiles with clang++
and g++
with -std=c++14
features ...
Another minimal reproducer developed by @maxpkatz :
#include <initializer_list>namespace detail {
bool f(std::initializer_list<bool> y) { return true; }
} // namespace detail
template <typename... X>
bool g(X &&... x) {
// breaks:
return detail::f({!x.valueless_by_exception()...});
// works only for N>1 parameter packs:
// return detail::f(std::initializer_list<bool>(!x.valueless_by_exception()...));
// fails as well:
// return detail::f(std::initializer_list<bool>{!x.valueless_by_exception()...});
}
int main() {
return 0;
}
Fixed in 3c7fc8266bb46046b42c2dc2663f9f505f0cec28
With Nvidia's
nvcc
, tested in versions 10.1.243 and 10.2.89, usinggcc
(v4.9-v8) as host compiler, the following example compiles with-std=c++11
but not with-std=c++14
.The C++14 error is:
Naive work-around so far: