Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32731 - [clang] 3.1 fails to compile libstdc++ <chrono> 4.7.2

Attached to Project: Arch Linux
Opened by Vincent Ollivier (vinc) - Saturday, 17 November 2012, 13:14 GMT
Last edited by Evangelos Foutras (foutrelis) - Sunday, 18 November 2012, 02:04 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Clang fails to compile C++11 code including libstdc++ <chrono> where GCC 4.7 works fine.

Additional info:
* clang 3.1
* libstdc++ 4.7.2

Steps to reproduce:

Compile:

#include <chrono>
int main()
{
return 0;
}

With:

$ clang++ -std=c++11 -c test.cpp
In file included from test.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/chrono:240:10: error: cannot cast from lvalue of type 'const long long' to rvalue reference type 'rep'
(aka 'long long &&'); types are not compatible
: __r(static_cast<rep>(__rep)) { }
^~~~~~~~~~~~~~~~~~~~~~~

Patch:

A very small patch to libstdc++ is available[1] and this bug had already been reported to LLVM[2] and Debian[3] bug trackers.

[1]: http://clang.llvm.org/libstdc++4.7-clang11.patch
[2]: http://llvm.org/bugs/show_bug.cgi?id=12893
[3]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666539
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Sunday, 18 November 2012, 02:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in clang 3.1-6.
Comment by Allan McRae (Allan) - Saturday, 17 November 2012, 13:56 GMT
I will not apply the patch to gcc. Instead, backport clang r166455.

Loading...