diff options
author | Jason Merrill <jason@redhat.com> | 2024-05-16 16:09:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2024-05-29 09:48:05 -0400 |
commit | ff41abdca0ab9993b6170b9b1f46b3a40921f1b0 (patch) | |
tree | 24a581f44760ca6565531b62091634ed064381a7 /gcc/cp/lang-specs.h | |
parent | 18f477980c8597fe3dca2c2e8bd533c0c2b17aa6 (diff) | |
download | gcc-ff41abdca0ab9993b6170b9b1f46b3a40921f1b0.zip gcc-ff41abdca0ab9993b6170b9b1f46b3a40921f1b0.tar.gz gcc-ff41abdca0ab9993b6170b9b1f46b3a40921f1b0.tar.bz2 |
c++: add module extensions
There is a trend in the broader C++ community to use a different extension
for module interface units, even though (in GCC) they are compiled in the
same way as other source files. Let's recognize these extensions as C++.
.ixx is the MSVC standard, while the .c*m are supported by Clang. libc++
standard headers use .cppm, as their other source files use .cpp.
Perhaps libstdc++ might use .ccm for parallel consistency?
One issue with .c++m is that libcpp/mkdeps.cc has been using it for the
phony dependencies to express module dependencies, so I'm changing mkdeps to
something less likely to be an actual file, ".c++-module".
gcc/cp/ChangeLog:
* lang-specs.h: Add module interface extensions.
gcc/ChangeLog:
* doc/invoke.texi: Update module extension docs.
libcpp/ChangeLog:
* mkdeps.cc (make_write): Change .c++m to .c++-module.
gcc/testsuite/ChangeLog:
* g++.dg/modules/dep-1_a.C
* g++.dg/modules/dep-1_b.C
* g++.dg/modules/dep-2.C: Change .c++m to .c++-module.
Diffstat (limited to 'gcc/cp/lang-specs.h')
-rw-r--r-- | gcc/cp/lang-specs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index 7a7f5ff..e565156 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -39,6 +39,12 @@ along with GCC; see the file COPYING3. If not see {".HPP", "@c++-header", 0, 0, 0}, {".tcc", "@c++-header", 0, 0, 0}, {".hh", "@c++-header", 0, 0, 0}, + /* Module interface unit. Should there also be a .C counterpart? */ + {".ixx", "@c++", 0, 0, 0}, /* MSVC */ + {".cppm", "@c++", 0, 0, 0}, /* Clang/libc++ */ + {".cxxm", "@c++", 0, 0, 0}, + {".c++m", "@c++", 0, 0, 0}, + {".ccm", "@c++", 0, 0, 0}, {"@c++-header", "%{E|M|MM:cc1plus -E %{fmodules-ts:-fdirectives-only -fmodule-header}" " %(cpp_options) %2 %(cpp_debug_options)}" |