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

Prism C++ misidentifies declaration of overloaded operator< as a generic function #3042

Closed
Tarindel opened this issue Aug 19, 2021 · 0 comments · Fixed by #3043
Closed

Prism C++ misidentifies declaration of overloaded operator< as a generic function #3042

Tarindel opened this issue Aug 19, 2021 · 0 comments · Fixed by #3043

Comments

@Tarindel
Copy link

Information:

Description
See example

Example

  1. Go to https://prismjs.com/test.html#language=cpp
  2. Paste the following into the box:
class Foo
{
public:

	friend bool operator== (const Foo& f1, const Foo& f2);
	friend bool operator!= (const Foo& f1, const Foo& f2);

	friend bool operator< (const Foo& f1, const Foo& f2);
	friend bool operator> (const Foo& f1, const Foo& f2);

	friend bool operator<= (const Foo& f1, const Foo& f2);
	friend bool operator>= (const Foo& f1, const Foo& f2);
};
  1. Inspect operator< in your browser

Result: Operator< has been misidentified as a generic function and all of the code between operator< and operator> is in a nested span

Other details: This doesn't happen if overloaded operator> is not present. It does happen in the following minimal case:

operator< (int foo);
>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants