nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
32 stars 16 forks source link

llvm16 friend bug #1624

Closed excaliburtb closed 8 months ago

excaliburtb commented 8 months ago

This was produced on a RH8/Oracle8 box (not sure it matters) with the latest update to LLVM16 (*definitely matters) and Trick 19.7.0.

A friend declaration of a class that is instantiated in the S_define is not getting added to that sim objects attributes in trick-ICG. See the attached sim setup to see a basic example of the behavior:

SIM_llvm16_err.zip

When you run it, you'll see that the broken class ref_name_from_address results in an offset instead of a name. And, if you look in the generated io_S_source.cpp, you'll see that attrFooBrokenTestSimObject is missing the "fooBroken" entry.

sharmeye commented 8 months ago

Thanks Thomas, we'll get looking at it. Also, thanks for the example sim you provided, it's super helpful to track down the issue. We're looking in more detail into what changed in llvm16 and the c++17 standard. We'll keep you posted