-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add overloads for complex multiply to fix clang16 #2892
Conversation
Were you able to confirm it's limited to just |
It's not an issue under clang-16, but the Jenkins failure indicates that it's needed for clang-7 now. Strange. |
Weird. So a model like https://github.com/stan-dev/stanc3/blob/master/test/integration/good/code-gen/complex_numbers/basic_op_param.stan compiled under clang16 with only the changes here, but now CI is complaining for other operators? |
Yep |
Really odd. I don’t know enough about the ADL rules. It looks like this patch (the original one, at least) fixed the conda build issue. I’m sure adding more manual operator overloads is probably never a bad thing, but I’ll try the final version of this PR before actually pushing go on the conda update |
@WardBrian turns out the issue here was that the overloads for basic arithmetic with All's passed, so should be good to merge if the feedstock pr also passes |
Thanks to both! Should we do a 2.32.1? |
I do think it should be included in a bugfix release rather than waiting for the next full release but I don't have any strong opinions on whether the issue is urgent enough to warrant a bugfix release now, rather than waiting a time and seeing if any other issues come up. @WardBrian what are your thoughts? |
I can manually include the patch for conda, so it’s not strictly necessary from my end for it to be released as a patch. It would probably be nice, though. I propose waiting a few more days to see if anything else comes up in either case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Thanks for jumping on this @andrjohns
Summary
As discovered over in this cmdstan issue, clang16 has introduced changes to their
std::complex
implementation that has broken ADL for our complex multiply. This PR adds explicit complex overloads for multiplication so that they're instantiated first during the template resolution.Both the complex unit tests and the stanc3 complex test models now compile under clang16 with these changes.
Tests
N/A currently, but additional CI is planned to catch these kinds of issues sooner
Side Effects
N/A
Release notes
Updated complex multiplication overloads for clang16 compatibility
Checklist
Math issue #(issue number)
Copyright holder: Andrew Johnson
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested