Skip to content

Incorrect formating of ||= logical or assignment #73

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

Closed
juanpablius opened this issue Dec 3, 2021 · 2 comments
Closed

Incorrect formating of ||= logical or assignment #73

juanpablius opened this issue Dec 3, 2021 · 2 comments

Comments

@juanpablius
Copy link

When running clang format on JavaScript sentences:

let myVar;
myVar ||= 2;

clang-format transforms it to

let myVar;
myVar || = 2;

It seems it doesn't understand the logical or assignemt from js
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment

@mprobst
Copy link
Contributor

mprobst commented Dec 3, 2021

This was fixed in LLVM change 16212b8b3e4f, about a year ago.

I believe this change should be included in recent releases of clang-format - maybe you're on an old version?

@mprobst mprobst closed this as completed Dec 3, 2021
@mprobst
Copy link
Contributor

mprobst commented Dec 3, 2021

Please reopen if you can repro with the latest version.

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