Jason Merrill 9783f6f2f6 c++/modules: #include <vector> -> import <bits/stdc++.h>
Since the standard library doesn't preclude an #include of a standard
library header from bringing in declarations from other headers, we can
translate an #include of any of the importable headers as an import of
<bits/stdc++.h>.

To reduce the amount of C++ standard knowledge encoded in libcpp, I extend
the translate_include callback to allow it to suggest an alternate header to
try translating.  It's a bit awkward to bounce back and forth, but this
seems like the right division of responsibilities.

libcpp/ChangeLog:

	* include/cpplib.h (struct cpp_callbacks): Replace 'path' parameter
	with file, angle_brackets, and alternate name.
	(cpp_get_name): Declare.
	* files.cc (cpp_get_name): New.
	(_cpp_stack_include, _cpp_post_stack_file, _cpp_stack_file)
	(_cpp_stack_translated_file): Refactor, try alternate file.

gcc/cp/ChangeLog:

	* module.cc (maybe_translate_include): Suggest <bits/stdc++.h>
	as an alternate for importable standard library headers.
	(importable_headers, is_importable_header): New.

gcc/ChangeLog:

	* doc/invoke.texi (C++ Modules): Remove standard library header
	units from missing pieces, mention importable header redirection.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/compile-std1.C: Test <vector> translation.
2025-12-10 23:11:26 +08:00
2025-06-03 00:18:06 +00:00
2025-12-10 00:16:32 +00:00
2025-12-09 00:16:30 +00:00
2025-08-29 00:19:55 +00:00
2025-06-23 00:16:33 +00:00
2025-12-02 09:47:45 +00:00
2025-01-02 11:59:57 +01:00
2025-12-10 00:16:32 +00:00
2025-11-07 00:20:18 +00:00
2025-12-02 09:47:45 +00:00
2025-11-22 00:20:52 +00:00
2025-01-02 11:59:57 +01:00
2025-11-04 00:20:26 +00:00
2025-12-01 11:41:53 +01:00
2025-12-10 00:16:32 +00:00
2025-11-30 00:16:27 +00:00
2025-11-12 00:22:41 +00:00
2025-11-24 00:18:45 +00:00
2025-11-29 12:28:38 +01:00
2025-12-10 00:16:32 +00:00
2025-11-04 00:20:26 +00:00
2025-12-01 00:16:36 +00:00
2025-11-20 00:19:40 +00:00
2025-11-04 00:20:26 +00:00
2025-12-10 00:16:32 +00:00
2025-11-04 00:20:26 +00:00
2025-11-04 00:20:26 +00:00
2025-12-10 00:16:32 +00:00
2025-11-04 00:20:26 +00:00
2025-11-04 00:20:26 +00:00
2025-09-02 00:19:26 +00:00
2025-11-04 00:20:26 +00:00
2025-12-09 00:16:30 +00:00
2025-10-11 11:08:01 +02:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:27 +01:00
2025-12-08 10:36:41 -05:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:27 +01:00
2025-11-30 01:52:24 +01:00
2025-10-11 11:08:01 +02:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%