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

Issue with detection of < operator #217

Open
ajay-mk opened this issue Jul 13, 2024 · 3 comments
Open

Issue with detection of < operator #217

ajay-mk opened this issue Jul 13, 2024 · 3 comments

Comments

@ajay-mk
Copy link

ajay-mk commented Jul 13, 2024

Getting the following error with version 0.3.7:

meta::is_less_than_comparable< T, std::void_t< decltype(std::declval< const T & >()< std::declval< const T & >())> > has 5 '<' and 4 '>', exhale does not know what to do with your code.Traceback (most recent call last)

The additional < is the operator, not part of the braces, so the syntax is correct. Looks similar to #169.
If I understand things correctly, the syntax doesn't satisfy the conditions for operator_overload to be True in the following lines

exhale/exhale/graph.py

Lines 2449 to 2452 in c995925

if node.kind == "function" and "operator" in node.name:
operator_overload = True
else:
operator_overload = False

Version info:
Doxygen: 1.11
Breathe: 4.35
Sphinx: 7.1.2

ajay-mk added a commit to ajay-mk/SeQuant that referenced this issue Jul 13, 2024
This is because of a bug in Exhale. See svenevs/exhale#217
ajay-mk added a commit to ajay-mk/SeQuant that referenced this issue Jul 22, 2024
This is because of a bug in Exhale. See svenevs/exhale#217
@ajay-mk
Copy link
Author

ajay-mk commented Jul 29, 2024

Gentle bump @svenevs. Not urgent, but it would be nice to have this fixed.

@svenevs
Copy link
Owner

svenevs commented Jul 30, 2024

Hey, thank you for the report and gentle nudge. This is unfortunately actually quite a difficult issue, and may mean we cannot solve this problem with regex anymore... Teaching exhale how to parse more complicated templates isn't exactly a viable long term solution.

If you post a self contained example (just give me working compilable / runnable header file and source file of relevant). I can add it to the (very complicated) test framework IF you agree to it being CC0 license.

Giving a self contained reproducer can help bootstrap the solution / save time. But I am worried that there may not be a clean solution here 😕

Please feel free to nudge again this Saturday so I remember to take a look, this week is shaping up to be pretty chaotic.

I'm sorry to share the mixed bag news (may not be a quick fix, which may mean no easy fix attainable). I'm pretty sure concepts break the assumptions being made in the code you linked.

Edit: clarification: I'm pretty sure there are other hidden problems with that code, so it's worth doing a survey of what has changed and what possible solutions are available these days.

@ajay-mk
Copy link
Author

ajay-mk commented Aug 1, 2024

Thanks for your reply. I have been playing around with breathe-apidoc and exhale and still haven't decided which one to pick, but leaning towards exhale 🙂

Here is an example code to reproduce the issue (I hope this is enough):

template <typename T, typename = std::void_t<>>
struct is_less_than_comparable : public std::false_type {};

template <typename T>
struct is_less_than_comparable<T,
                               std::void_t<decltype(std::declval<const T &>() <
                                                    std::declval<const T &>())>>
    : public std::true_type {};

ajay-mk added a commit to ajay-mk/SeQuant that referenced this issue Aug 12, 2024
This is because of a bug in Exhale. See svenevs/exhale#217
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

No branches or pull requests

2 participants