-
Notifications
You must be signed in to change notification settings - Fork 125
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
Fix isUnusedResult to work with clad::array #543
Conversation
what is " Expr " type? |
Hi @ShounakDas101 , Expr is basically a class from the Clang AST . It is capable of representing multiple C/C++ expressions like operators,literal . I myself am trying to figure out Clad and Clang and as you dwell into the code and documentation , more things will make sense. I might not be entirely right but this is what I think of Expr as of now . Please let me know if you find a better explanation for the following . |
Hi @Daksh1603 #include "clad/Differentiator/Differentiator.h" int main()
} I dont think I can replicate the error properly with this nor did your changes seem to affect the outputs. Also in the issue this is the example given double arr(3); <-------- is this just a normal array declaration or smth else? Note: for some reason iostream not showing up |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #543 +/- ##
=======================================
Coverage 92.50% 92.50%
=======================================
Files 39 39
Lines 5600 5602 +2
=======================================
+ Hits 5180 5182 +2
Misses 420 420
|
@Daksh1603 I was expecting some test changes as well that I don't see. Can you also please answer to @ShounakDas101 questions? |
Hi @ShounakDas101 , Apologies for the late reply , as I had my mid semester test today .
However , this is what I think is right and may not be absolutely correct . |
Hi @parth-07 @vgvassilev ,
This seems like a reasonable approach but what concerns me is the fact that getReferencedDeclOfCallee() might end up pointing to the operator which is being overloaded instead . A little more guidance will be appreciated on this and I am confident that Ill end up fixing it at the earliest . |
Why do you need two builds?
This solution has some major flaws. It seems it would only work for |
Let's close this PR as the issue was fixed in #797. |
Fixes #350
This pull request addresses an issue with the isUnusedResult function in CLAD, which currently does not correctly identify unused results for clad::array expressions.
To fix this issue , I have made some minor changes to the isUnusedResult function from the clad/Differentiator/VisitorBase.cpp file which explicity checks whether the passed expression is an instance of 'clad::array'.