gcc/libcpp/include
Jason Merrill a5933118f3 c++: modules and #pragma diagnostic
To respect the #pragma diagnostic lines in libstdc++ headers when compiling
with module std, we need to represent them in the module.

I think it's reasonable to give serializers direct access to the underlying
data, as here with get_classification_history.  This is a different approach
from how Jakub made PCH streaming members of diagnostic_option_classifier,
but it seems to me that modules handling belongs in module.cc.

libcpp/ChangeLog:

	* line-map.cc (linemap_location_from_module_p): Add.
	* include/line-map.h: Declare it.

gcc/ChangeLog:

	* diagnostic.h (diagnostic_option_classifier): Friend
	diagnostic_context.
	(diagnostic_context::get_classification_history): New.

gcc/cp/ChangeLog:

	* module.cc (module_state::write_diagnostic_classification): New.
	(module_state::write_begin): Call it.
	(module_state::read_diagnostic_classification): New.
	(module_state::read_initial): Call it.
	(dk_string, dump_dc_change): New.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/warn-spec-3_a.C: New test.
	* g++.dg/modules/warn-spec-3_b.C: New test.
	* g++.dg/modules/warn-spec-3_c.C: New test.
2025-06-17 08:04:18 -04:00
..
cpplib.h c-family: Improve location for -Wunknown-pragmas in a _Pragma [PR118838] 2025-04-27 22:35:25 -04:00
label-text.h Update copyright years. 2025-01-02 11:59:57 +01:00
line-map.h c++: modules and #pragma diagnostic 2025-06-17 08:04:18 -04:00
mkdeps.h Update copyright years. 2025-01-02 11:59:57 +01:00
rich-location.h Update copyright years. 2025-01-02 11:59:57 +01:00
symtab.h Update copyright years. 2025-01-02 11:59:57 +01:00