public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99413] New: internal library headers are not header-unit ready
@ 2021-03-05 15:13 nathan at gcc dot gnu.org
2021-03-05 15:48 ` [Bug libstdc++/99413] " redi at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-03-05 15:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99413
Bug ID: 99413
Summary: internal library headers are not header-unit ready
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: nathan at gcc dot gnu.org
Target Milestone: ---
We're attempting to build the std library as a bunch of header-units. The
include graph partitioner naturally discovers that internal headers from bits/
are included everywhere, and should therefore be header-units themselves. But
several (many?, most?) are not stand alone, and expect their includer to have
included some necessary definitions.
The ones we've hit so far are[*]
bits/predefined_ops.h:153:9: error: '_GLIBCXX14_CONSTEXPR' does not name a type
bits/functional_hash.h:71:31: error: '__void_t' was not declared in this scope
bits/range_access.h:179:33: error: 'reverse_iterator' does not name a type
[*] for reasons we're stuck with gcc-9 era libstdc++.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/99413] internal library headers are not header-unit ready
2021-03-05 15:13 [Bug libstdc++/99413] New: internal library headers are not header-unit ready nathan at gcc dot gnu.org
@ 2021-03-05 15:48 ` redi at gcc dot gnu.org
2021-03-05 16:00 ` nathan at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-05 15:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99413
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-03-05
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There are *many* such problems e.g.
/home/jwakely/gcc/11/include/c++/11.0.1/bits/stl_set.h:92:52: error: 'less' in
namespace 'std' does not name a template type
92 | template<typename _Key, typename _Compare = std::less<_Key>,
| ^~~~
But in most cases the header is only included from exactly one place (in this
case, from <set>). Will they not be selected to be header units by your
selection criteria, and so can be ignored (at least for now)?
None of the bits/foo.tcc files are ever intended to be included from anywhere
except at the end of the corresponding bits/foo.h header. Do those ones need to
be fixed? Again, they are included in exactly one place (explicitly by design
here, rather than just how the library is arranged).
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/99413] internal library headers are not header-unit ready
2021-03-05 15:13 [Bug libstdc++/99413] New: internal library headers are not header-unit ready nathan at gcc dot gnu.org
2021-03-05 15:48 ` [Bug libstdc++/99413] " redi at gcc dot gnu.org
@ 2021-03-05 16:00 ` nathan at gcc dot gnu.org
2021-03-10 15:28 ` cvs-commit at gcc dot gnu.org
2021-03-11 13:15 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-03-05 16:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99413
--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Correct. We're only picking headers that are either (a) user-facing or (b)
included from more than one place.
Specifically we're partitioning the include graph into a set of multi-reached
sub-graphs.
And we're maintaining a bad-list, which are the case reported here.
Hope that helps.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/99413] internal library headers are not header-unit ready
2021-03-05 15:13 [Bug libstdc++/99413] New: internal library headers are not header-unit ready nathan at gcc dot gnu.org
2021-03-05 15:48 ` [Bug libstdc++/99413] " redi at gcc dot gnu.org
2021-03-05 16:00 ` nathan at gcc dot gnu.org
@ 2021-03-10 15:28 ` cvs-commit at gcc dot gnu.org
2021-03-11 13:15 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-10 15:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99413
--- Comment #3 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:47cca0288d06bd851e5801d13bbee7d9374b685d
commit r11-7604-g47cca0288d06bd851e5801d13bbee7d9374b685d
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Mar 10 15:27:41 2021 +0000
libstdc++: Fix headers that can't be used as header units [PR 99413]
This adds missing includes to internal library headers which get
included from more than one other header, so that they can be compiled
as a stand-alone header unit.
For existing use cases these includes are no-ops because they're already
done by the header that includes these files. For compiling them as a
header unit, this ensures that they include what they use.
libstdc++-v3/ChangeLog:
PR libstdc++/99413
* include/bits/align.h: Include debug/assertions.h.
* include/bits/codecvt.h: Include bits/c++config.h.
* include/bits/enable_special_members.h: Likewise.
* include/bits/erase_if.h: Likewise.
* include/bits/functional_hash.h: Include <type_traits>.
* include/bits/invoke.h: Include bits/move.h.
* include/bits/ostream_insert.h: Include bits/exception_defines.h.
* include/bits/parse_numbers.h: Include <type_traits>.
* include/bits/predefined_ops.h: Include bits/c++config.h.
* include/bits/range_access.h: Include bits/stl_iterator.h.
* include/bits/stl_bvector.h: Do not include bits/stl_vector.h.
* include/bits/stl_iterator.h: Include
bits/stl_iterator_base_types.h.
* include/bits/stl_uninitialized.h: Include bits/stl_algobase.h.
* include/bits/uniform_int_dist.h: Include bits/concept_check.h.
* include/bits/unique_lock.h: Include bits/std_mutex.h.
* include/debug/assertions.h: Include bits/c++config.h.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/99413] internal library headers are not header-unit ready
2021-03-05 15:13 [Bug libstdc++/99413] New: internal library headers are not header-unit ready nathan at gcc dot gnu.org
` (2 preceding siblings ...)
2021-03-10 15:28 ` cvs-commit at gcc dot gnu.org
@ 2021-03-11 13:15 ` redi at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-11 13:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99413
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Target Milestone|--- |11.0
Status|NEW |RESOLVED
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for gcc-11.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-11 13:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 15:13 [Bug libstdc++/99413] New: internal library headers are not header-unit ready nathan at gcc dot gnu.org
2021-03-05 15:48 ` [Bug libstdc++/99413] " redi at gcc dot gnu.org
2021-03-05 16:00 ` nathan at gcc dot gnu.org
2021-03-10 15:28 ` cvs-commit at gcc dot gnu.org
2021-03-11 13:15 ` 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).