Skip to content
Snippets Groups Projects
  • Jason Merrill's avatar
    ff41abdc
    c++: add module extensions · ff41abdc
    Jason Merrill authored
    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.
    ff41abdc
    History
    c++: add module extensions
    Jason Merrill authored
    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.