Bug#666539: clang: Fails when trying to include chrono from C++11

Mario Lang mlang at debian.org
Sat Mar 31 15:49:38 UTC 2012


Package: clang
Version: 3.0-6
Severity: normal

Dear Maintainer,

clang fails to include chrono from C++11.

Here is a minimal example program:

---<snip>---
#include <chrono>
int main() { }
---<snip>---

Building with GCC (4.6 and 4.7) works fine:

x4:/tmp% g++-4.6 -std=c++0x -o clang-chrono clang-chrono.cxx
x4:/tmp% g++-4.7 -std=c++0x -o clang-chrono clang-chrono.cxx

However, building with clang fails:

x4:/tmp% clang++ -std=c++0x -o clang-chrono clang-chrono.cxx
In file included from clang-chrono.cxx:1:
/usr/include/c++/4.6/chrono:666:7: error: static_assert expression is not an integral constant expression
      static_assert(system_clock::duration::min()
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
zsh: exit 1     clang++ -std=c++0x -o clang-chrono clang-chrono.cxx

The same error happens with chrono from c++/4.7/.

I realize that this might be a libstdc++ bug.  However, gcc does not
trigger it, only clang seems to be strict enough (or broken enough? to
actually trigger it.  In any case, C++11 chrono is a no go on clang
right now :(.

-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang/key at db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>





More information about the Pkg-llvm-team mailing list