[LLVMbugs] [Bug 12893] New: libstdc++ <chrono> cannot be compiled
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat May 19 15:44:00 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12893
Bug #: 12893
Summary: libstdc++ <chrono> cannot be compiled
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: lcid-fire at gmx.net
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
I am trying to compile C++11 threading code, which includes <chrono>. My c++
lib is libstdc++ 4.7.
It complains:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/thread:37:
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:240:10:
error: cannot cast from lvalue of type 'const long' to rvalue reference type
'rep' (aka 'long &&'); types are not compatible
: __r(static_cast<rep>(__rep)) { }
^~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:128:13:
note: in instantiation of function template specialization
'std::chrono::duration<long &&, std::ratio<1, 1000000> >::duration<long, void>'
requested here
return _ToDur(static_cast<__to_rep>(__d.count()));
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:182:9:
note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long &&, std::ratio<1,
1000000> >, std::ratio<1, 1>, long &&, true, true>::__cast<long, std::ratio<1,
1000000> >' requested here
return __dc::__cast(__d);
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:247:10:
note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long &&, std::ratio<1,
1000000> >, long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:471:9:
note: in instantiation of function template specialization
'std::chrono::duration<long &&, std::ratio<1, 1000000> >::duration<long,
std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:682:7:
note: in instantiation of function template specialization
'std::chrono::operator<<long, std::ratio<1, 1000000>, long, std::ratio<1,
1000000> >' requested here
< system_clock::duration::zero(),
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:128:13:
error: call to implicitly-deleted copy constructor of
'std::chrono::duration<long &&, std::ratio<1, 1000000> >'
return _ToDur(static_cast<__to_rep>(__d.count()));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:182:9:
note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long &&, std::ratio<1,
1000000> >, std::ratio<1, 1>, long &&, true, true>::__cast<long, std::ratio<1,
1000000> >' requested here
return __dc::__cast(__d);
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:247:10:
note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long &&, std::ratio<1,
1000000> >, long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:471:9:
note: in instantiation of function template specialization
'std::chrono::duration<long &&, std::ratio<1, 1000000> >::duration<long,
std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:682:7:
note: in instantiation of function template specialization
'std::chrono::operator<<long, std::ratio<1, 1000000>, long, std::ratio<1,
1000000> >' requested here
< system_clock::duration::zero(),
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:233:12:
note: explicitly defaulted function was implicitly deleted here
constexpr duration(const duration&) = default;
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:349:6:
note: copy constructor of 'duration<long &&, std::ratio<1, 1000000> >' is
implicitly deleted because field '__r' is of rvalue reference type 'rep' (aka
'long &&')
rep __r;
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:182:9:
error: call to implicitly-deleted copy constructor of 'typename
enable_if<__is_duration<duration<long &&, ratio<1, 1000000> > >::value,
duration<long &&, ratio<1, 1000000> > >::type' (aka 'std::chrono::duration<long
&&, std::ratio<1, 1000000> >')
return __dc::__cast(__d);
^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:247:10:
note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long &&, std::ratio<1,
1000000> >, long, std::ratio<1, 1000000> >' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:471:9:
note: in instantiation of function template specialization
'std::chrono::duration<long &&, std::ratio<1, 1000000> >::duration<long,
std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:682:7:
note: in instantiation of function template specialization
'std::chrono::operator<<long, std::ratio<1, 1000000>, long, std::ratio<1,
1000000> >' requested here
< system_clock::duration::zero(),
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:233:12:
note: explicitly defaulted function was implicitly deleted here
constexpr duration(const duration&) = default;
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:349:6:
note: copy constructor of 'duration<long &&, std::ratio<1, 1000000> >' is
implicitly deleted because field '__r' is of rvalue reference type 'rep' (aka
'long &&')
rep __r;
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:255:11:
error: rvalue reference to type 'long' cannot bind to lvalue of type 'long'
{ return __r; }
^~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:247:39:
note: in instantiation of member function 'std::chrono::duration<long &&,
std::ratio<1, 1000000> >::count' requested here
: __r(duration_cast<duration>(__d).count()) { }
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:471:9:
note: in instantiation of function template specialization
'std::chrono::duration<long &&, std::ratio<1, 1000000> >::duration<long,
std::ratio<1, 1000000>, void>' requested here
return __ct(__lhs).count() < __ct(__rhs).count();
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:682:7:
note: in instantiation of function template specialization
'std::chrono::operator<<long, std::ratio<1, 1000000>, long, std::ratio<1,
1000000> >' requested here
< system_clock::duration::zero(),
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:681:21:
error: static_assert expression is not an integral constant expression
static_assert(system_clock::duration::min()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:681:21:
note: undefined function 'operator<<long, std::ratio<1, 1000000>, long,
std::ratio<1, 1000000> >' cannot be used in a constant expression
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:465:7:
note: declared here
operator<(const duration<_Rep1, _Period1>& __lhs,
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:141:40:
error: cannot cast from lvalue of type 'const intmax_t' (aka 'const long') to
rvalue reference type 'long &&'; types are not compatible
static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:182:9:
note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1, 1>
>, std::ratio<1, 1000000>, long &&, true, false>::__cast<long, std::ratio<1,
1000000> >' requested here
return __dc::__cast(__d);
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:694:21:
note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long, std::ratio<1, 1> >,
long, std::ratio<1, 1000000> >' requested here
return std::time_t(duration_cast<chrono::seconds>
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:154:40:
error: cannot cast from lvalue of type 'const intmax_t' (aka 'const long') to
rvalue reference type 'long &&'; types are not compatible
static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:182:9:
note: in instantiation of function template specialization
'std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1,
1000000> >, std::ratio<1000000, 1>, long &&, false, true>::__cast<long,
std::ratio<1, 1> >' requested here
return __dc::__cast(__d);
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:582:22:
note: in instantiation of function template specialization
'std::chrono::duration_cast<std::chrono::duration<long, std::ratio<1, 1000000>
>, long, std::ratio<1, 1> >' requested here
return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
^
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:702:9:
note: in instantiation of function template specialization
'std::chrono::time_point_cast<std::chrono::duration<long, std::ratio<1,
1000000> >, std::chrono::system_clock, std::chrono::duration<long,
std::ratio<1, 1> > >' requested here
return time_point_cast<system_clock::duration>
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list