clad icon indicating copy to clipboard operation
clad copied to clipboard

Complain if signatures of the forward declaration and generated code mismatch

Open vgvassilev opened this issue 3 months ago • 2 comments

Clad builds a gradient with a specific signature. It also allows that gradient function signature to be forward-declared. However if both mismatch there are subtle crashes in CodeGen. We should detect such cases and issue an error if they are in the same translation unit:

For example,

https://github.com/vgvassilev/clad/blob/d7e5434cd4aecc9e8a3e61e1660f1543ae5f3954/test/Gradient/Gradients.C#L269

returns void, but the forward declaration is:

https://github.com/vgvassilev/clad/blob/d7e5434cd4aecc9e8a3e61e1660f1543ae5f3954/test/Gradient/Gradients.C#L283

which leads to subtle issues.

vgvassilev avatar Mar 09 '24 09:03 vgvassilev

Hi @vgvassilev , Can I contribute to this issue?

kaushal-malpure avatar Mar 10 '24 14:03 kaushal-malpure

@kaushal-malpure, please select one issue and solve it, please do not write under every open issue.

vgvassilev avatar Mar 10 '24 15:03 vgvassilev