Clang gives error for "static_assert" in GCC 4.6 libstdc++ <chrono> header

Clang gives an error for a static_assert in GCC 4.6's <chrono> header
(just build a simple hello world including <thread>):

M:/Development/mingw64/include/c++/4.6.1/chrono:666:7: error:
static_assert expression is not an integral constant expression
      static_assert(system_clock::duration::min()
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Checking the C++ status page I saw that static_assert should work
mostly. Is this a problem in the part that works, or is this error
generated because it doesn't work well yet (in which case, the colors
on the status page are very misleading.

Thanks!

Ruben

PS: please reply-to-all.

clang doesn't yet implement constexpr, and therefore system_clock::duration::min() is not something known at compile time. static_assert only works with compile-time information. The <chrono> that comes with libc++ (http://libcxx.llvm.org/) has not yet been constepxr'd, and so works with clang.

Howard

Clang gives an error for a static_assert in GCC 4.6's <chrono> header
(just build a simple hello world including <thread>):

M:/Development/mingw64/include/c++/4.6.1/chrono:666:7: error:
static_assert expression is not an integral constant expression
static_assert(system_clock::duration::min()
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Checking the C++ status page I saw that static_assert should work
mostly. Is this a problem in the part that works, or is this error
generated because it doesn't work well yet (in which case, the colors
on the status page are very misleading.

clang doesn't yet implement constexpr, and therefore system_clock::duration::min() is not something known at compile time. static_assert only works with compile-time information.

OK, thanks, then I'll refrain from filing a bug.

The <chrono> that comes with libc++ (http://libcxx.llvm.org/) has not yet been constepxr'd, and so works with clang.

You don't understand how much I'd like to try libc++... too bad it
doesn't work with Windows/MinGW yet :frowning: