]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Clean up include translation [PR110980]
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 22 Aug 2024 11:04:11 +0000 (21:04 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Tue, 27 Aug 2024 01:03:14 +0000 (11:03 +1000)
commit98608342932e8951a4c8db3e9df79f9187424d53
treeb80e661d6dd60592fbd56957cd5d9350215684b0
parent9522fc8bb7812f2ad50eb038e0938bfd958e730f
c++/modules: Clean up include translation [PR110980]

Currently the handling of include translation is confusing to read,
using a tri-state integer without much clarity on what different states
mean.  This patch cleans this up to use explicit enumerators indicating
the different possible states instead, and fixes a bug where the option
'-flang-info-include-translate' ended being accidentally unusable.

PR c++/110980

gcc/cp/ChangeLog:

* module.cc (maybe_translate_include): Clean up.

gcc/testsuite/ChangeLog:

* g++.dg/modules/inc-xlate-2_a.H: New test.
* g++.dg/modules/inc-xlate-2_b.H: New test.
* g++.dg/modules/inc-xlate-3.h: New test.
* g++.dg/modules/inc-xlate-3_a.H: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/inc-xlate-2_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/inc-xlate-2_b.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/inc-xlate-3.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/inc-xlate-3_a.H [new file with mode: 0644]