public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
@ 2021-04-13 9:40 redi at gcc dot gnu.org
2021-04-13 9:41 ` [Bug libstdc++/100060] " redi at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13 9:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
Bug ID: 100060
Summary: [10/11 Regression] freestanding header <bit> includes
non-freestanding <ext/numeric_limits.h>
Product: gcc
Version: 10.3.1
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
As shown in Bug 100057 comment 16:
d:\cross_toolchains\x86_64-elf\x86_64-elf\include\c++\11.0.1\bit:37:10: fatal
error: ext/numeric_traits.h: No such file or directory
37 | #include <ext/numeric_traits.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
#include<bit>
We could either install that header for freestanding, or just use <limits> for
freestanding:
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -34,7 +34,22 @@
#if __cplusplus >= 201402L
#include <type_traits>
-#include <ext/numeric_traits.h>
+#if _GLIBCXX_HOSTED
+# include <ext/numeric_traits.h>
+#else
+# include <limits>
+/// @cond undocumented
+namespace __gnu_cxx
+{
+ template<typename _Tp>
+ struct __int_traits
+ {
+ static constexpr int __digits = std::numeric_limits<_Tp>::digits;
+ static constexpr _Tp __max = std::numeric_limits<_Tp>::max();
+ };
+}
+/// @endcond
+#endif
namespace std _GLIBCXX_VISIBILITY(default)
{
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/100060] [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
@ 2021-04-13 9:41 ` redi at gcc dot gnu.org
2021-04-13 9:42 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13 9:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |9.3.0
Target Milestone|--- |10.4
Priority|P3 |P2
Known to fail| |10.3.1, 11.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/100060] [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
2021-04-13 9:41 ` [Bug libstdc++/100060] " redi at gcc dot gnu.org
@ 2021-04-13 9:42 ` redi at gcc dot gnu.org
2021-04-13 16:54 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13 9:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2021-04-13
Status|UNCONFIRMED |ASSIGNED
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/100060] [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
2021-04-13 9:41 ` [Bug libstdc++/100060] " redi at gcc dot gnu.org
2021-04-13 9:42 ` redi at gcc dot gnu.org
@ 2021-04-13 16:54 ` cvs-commit at gcc dot gnu.org
2021-04-13 17:52 ` cvs-commit at gcc dot gnu.org
2021-04-13 17:52 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-13 16:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:474cb5a0a404c5de7c1cd21aac8b1b7e7ce95d9b
commit r11-8156-g474cb5a0a404c5de7c1cd21aac8b1b7e7ce95d9b
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Apr 13 16:55:37 2021 +0100
libstdc++: Fix <bit> to work freestanding [PR 100060]
libstdc++-v3/ChangeLog:
PR libstdc++/100060
* include/std/bit: Only include <ext/numeric_traits.h> for
hosted build, use <limits> otherwise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/100060] [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
` (2 preceding siblings ...)
2021-04-13 16:54 ` cvs-commit at gcc dot gnu.org
@ 2021-04-13 17:52 ` cvs-commit at gcc dot gnu.org
2021-04-13 17:52 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-13 17:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:
https://gcc.gnu.org/g:d83dace65b97112320042c7f4941b64ef339799d
commit r10-9703-gd83dace65b97112320042c7f4941b64ef339799d
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Apr 13 16:55:37 2021 +0100
libstdc++: Fix <bit> to work freestanding [PR 100060]
libstdc++-v3/ChangeLog:
PR libstdc++/100060
* include/std/bit: Only include <ext/numeric_traits.h> for
hosted build, use <limits> otherwise.
(cherry picked from commit 474cb5a0a404c5de7c1cd21aac8b1b7e7ce95d9b)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/100060] [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h>
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
` (3 preceding siblings ...)
2021-04-13 17:52 ` cvs-commit at gcc dot gnu.org
@ 2021-04-13 17:52 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-13 17:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100060
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 10.4
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-13 17:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 9:40 [Bug libstdc++/100060] New: [10/11 Regression] freestanding header <bit> includes non-freestanding <ext/numeric_limits.h> redi at gcc dot gnu.org
2021-04-13 9:41 ` [Bug libstdc++/100060] " redi at gcc dot gnu.org
2021-04-13 9:42 ` redi at gcc dot gnu.org
2021-04-13 16:54 ` cvs-commit at gcc dot gnu.org
2021-04-13 17:52 ` cvs-commit at gcc dot gnu.org
2021-04-13 17:52 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).