Skip to content
Snippets Groups Projects
  • Jason Merrill's avatar
    a29f481b
    c++: -include and header unit translation · a29f481b
    Jason Merrill authored
     Within a source file, #include is translated to import if a suitable header
     unit is available, but this wasn't working with -include.  This turned out
     to be because we suppressed the translation before the beginning of the
     main file.  After removing that, I had to tweak libcpp file handling to
     accommodate the way it moves from an -include to the main file.
    
    gcc/ChangeLog:
    
    	* doc/invoke.texi (C++ Modules): Mention -include.
    
    gcc/cp/ChangeLog:
    
    	* module.cc (maybe_translate_include): Allow before the main file.
    
    libcpp/ChangeLog:
    
    	* files.cc (_cpp_stack_file): LC_ENTER for -include header unit.
    
    gcc/testsuite/ChangeLog:
    
    	* g++.dg/modules/dashinclude-1_b.C: New test.
    	* g++.dg/modules/dashinclude-1_a.H: New test.
    a29f481b
    History
    c++: -include and header unit translation
    Jason Merrill authored
     Within a source file, #include is translated to import if a suitable header
     unit is available, but this wasn't working with -include.  This turned out
     to be because we suppressed the translation before the beginning of the
     main file.  After removing that, I had to tweak libcpp file handling to
     accommodate the way it moves from an -include to the main file.
    
    gcc/ChangeLog:
    
    	* doc/invoke.texi (C++ Modules): Mention -include.
    
    gcc/cp/ChangeLog:
    
    	* module.cc (maybe_translate_include): Allow before the main file.
    
    libcpp/ChangeLog:
    
    	* files.cc (_cpp_stack_file): LC_ENTER for -include header unit.
    
    gcc/testsuite/ChangeLog:
    
    	* g++.dg/modules/dashinclude-1_b.C: New test.
    	* g++.dg/modules/dashinclude-1_a.H: New test.