Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complain if signatures of forward declaration and generated gradient code do not match #836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeadSpheroid
Copy link
Contributor

This PR aims to fix #810 by crashing compilation whenever a mismatched gradient forward declaration is found.
There are two separate cases to handle the generated gradient code and search for a forward declaration.
If its a class/struct method, a lookup is performed in the class.
While if its a regular function, a lookup is performed in the TU.
Do let me know if any changes are necessary.

@DeadSpheroid
Copy link
Contributor Author

DeadSpheroid commented Mar 21, 2024

Additionally, the tests will require extensive changes as many tests still have mismatched signatures, one such example being
https://github.com/vgvassilev/clad/blob/5cb3c18e0c5cb4b41d0dcc80076eb97b61c61fae/test/Hessian/Hessians.C#L146C1-L162C3

@DeadSpheroid
Copy link
Contributor Author

I would merge the two code blocks for the class method and regular function into one, but for some reason i cant seem to get Sema::LookupName to look inside classes for results

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complain if signatures of the forward declaration and generated code mismatch
1 participant