Fix several ICG class template bugs (#1871)

* Fix several bugs with processing templates in ICG

- Fixed an issue where io_src code for some templates was being placed in the
  wrong file.
- Fixed an issue with templates being instantiated with templates as parameters.
- Fixed an issue with templates that instantiate templates.

Added additional tests to cover these cases.

* Moved the list of template argument header dependencies from ClassValues to PrintFileContents10 so they can be printed to the io_ file regardless of the order in which class info is printed.

* Moved the list of template argument header dependencies from ClassValues to PrintFileContents10 so they can be printed to the io_ file regardless of the order in which class info is printed.

Moved the list of template argument header dependencies from ClassValues to PrintFileContents10 so they can be printed to the io_ file regardless of the order in which class info is printed.

* Added support to handle template enum class type argument and removed some commented code.

Added support to handle template enum class type argument and removed some commented code.

---------

Co-authored-by: Hong Chen <hchen99@users.noreply.github.com>
This commit is contained in:
ninotarantino
2025-04-29 15:30:49 -05:00
committed by GitHub
parent 0312ca6fe8
commit 91a348d7e0
16 changed files with 269 additions and 62 deletions

View File

@ -290,9 +290,9 @@ bool FieldVisitor::ProcessTemplate(std::string in_name , clang::CXXRecordDecl *
template_spec_cvis.get_class_data()->setMangledTypeName(processed_templates[in_name]) ;
template_spec_cvis.TraverseCXXRecordDecl(crd) ;
// Set the actual type name and file name. Print the attributes for this template type
// Set the actual type name. Print the attributes for this template type
template_spec_cvis.get_class_data()->setName(in_name) ;
template_spec_cvis.get_class_data()->setFileName(fdes->getFileName()) ;
//template_spec_cvis.get_class_data()->setFileName(fdes->getFileName()) ;
pa.printClass(template_spec_cvis.get_class_data()) ;
if ( debug_level >= 4 ) {