rose-compiler / rose

Developed at Lawrence Livermore National Laboratory (LLNL), ROSE is an open source compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C (C89 and C98), C++ (C++98 and C++11), UPC, Fortran (77/95/2003), OpenMP, Java, Python and PHP applications.
http://rosecompiler.org
Other
606 stars 131 forks source link

GNU Attributes like gnu_attribute_alignment not copied by copy constructor and operator== #233

Open david-c-wong opened 1 year ago

david-c-wong commented 1 year ago

Hi all,

I found a potential issue that GNU attributes are not copied by the copy constructor and operator=() of classes like SgTypeModifier (e.g. https://github.com/rose-compiler/rose/blob/weekly/src/ROSETTA/Grammar/Support.code). Because of that, those attributes will get lost on copying.

Is this intended or a bug that can be fixed?

Thanks!

tristanvdb commented 1 year ago

Hi, I think we do want to copy these fields. If you have a patch, please open a pull request with me as reviewer. Thanks, -Tristan