Files
gcc/libcpp
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-07-31 00:21:08 +00:00
2025-12-08 00:16:25 +00:00
2025-08-10 08:01:02 -07:00
2025-11-10 11:34:20 +01:00
2025-01-02 11:59:57 +01:00
2025-12-07 15:34:15 +08:00
2025-01-02 11:59:57 +01:00
2025-10-08 18:02:39 +02:00
2025-10-08 18:02:39 +02:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-10-08 18:02:39 +02:00
2025-01-02 11:59:57 +01:00
2025-10-08 18:02:39 +02:00