mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 12:00:03 -05:00
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.
85 KiB
85 KiB