aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-10-04 10:33:16 -0400
committerJason Merrill <jason@redhat.com>2024-10-07 11:52:41 -0400
commitc877a27f04f648e53c27daa252ca46d47e49b3a1 (patch)
tree3e178d36d781722b0072d5fd7ee29543a5a00660 /gcc/gcov.cc
parent5fb1ab539e3315175d2e843f4ce40bde6dd7c520 (diff)
downloadgcc-c877a27f04f648e53c27daa252ca46d47e49b3a1.zip
gcc-c877a27f04f648e53c27daa252ca46d47e49b3a1.tar.gz
gcc-c877a27f04f648e53c27daa252ca46d47e49b3a1.tar.bz2
c++: modules don't require preprocessor output
init_modules has rejected -M -fmodules-ts on the premise that module dependency analysis requires macro expansion, but this is no longer accurate; P1857 prohibited module directives produced by macro expansion. They can still be dependent on #if directives, but those are still handled with -fdirectives-only. What wasn't working was -M or -dM, because cpp_scan_nooutput never called module_token_pre to implement the import. The simplest fix is to use the -fdirectives-only scan when modules are enabled and teach directives_only_cb about flag_no_output. gcc/cp/ChangeLog: * module.cc (init_modules): Don't warn about -M. gcc/c-family/ChangeLog: * c-ppoutput.cc (preprocess_file): For modules, use directives-only scan even with flag_no_output. (directives_only_cb): Respect flag_no_output. gcc/ChangeLog: * doc/invoke.texi (C++ Module Preprocessing): Allow -M, refer to -fdeps. gcc/testsuite/ChangeLog: * g++.dg/modules/macro-8_a.H: New test. * g++.dg/modules/macro-8_b.C: New test. * g++.dg/modules/macro-8_c.C: New test. * g++.dg/modules/macro-8_d.C: New test.
Diffstat (limited to 'gcc/gcov.cc')
0 files changed, 0 insertions, 0 deletions