CMakePP / CMakePPLang

Object-oriented extension to the CMake language.
http://cmakepp.github.io/CMakePPLang/
Apache License 2.0
11 stars 4 forks source link

Methods/constructors taking pointers are not callable #106

Closed AutonomicPerfectionist closed 1 year ago

AutonomicPerfectionist commented 1 year ago

Describe the bug Calling a method or constructor that takes a pointer type with a desc type fails because the check for whether the overload is callable fails. This appears to be due to cpp_sanitize_string() converting the asterisks in the pointer type to underscores. This is not done explicitly by us but by the MAKE_C_IDENTIFIER call inside the sanitize string function.

There's a couple ways to fix this:

  1. The easiest is to just add the underscore as a valid way to declare a pointer type
  2. Find where the pointer type is mutated and fix it. Doing so will fix this particular issue but extensive testing should be done to ensure similar mutations aren't done elsewhere
  3. Change cpp_sanitize_string() to not use MAKE_C_IDENTIFIER, I don't personally advocate for this as it may break significant amounts of downstream code