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

modernize check to use alternative operator representations #25569

Closed
EugeneZelenko opened this issue Oct 15, 2015 · 9 comments
Closed

modernize check to use alternative operator representations #25569

EugeneZelenko opened this issue Oct 15, 2015 · 9 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang-tidy enhancement Improving things as opposed to bug fixing, e.g. new or missing feature

Comments

@EugeneZelenko
Copy link
Contributor

Bugzilla Link 25195
Version unspecified
OS All
CC @gnzlbg,@mgehre

Extended Description

Will be good idea to have modernize check which could replace traditional operators representations with alternative ones: && with and, || with or, etc. See http://en.cppreference.com/w/cpp/language/operator_alternative.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 16, 2015

Why? Alternative tokens are only needed for the poor developers who have difficulties entering some characters (&|^~{}[]) due to the limitations of their environment. I have never seen a recommendation to use them in normal circumstances, and I would certainly refrain from suggesting their use as a style rule.

@EugeneZelenko
Copy link
Contributor Author

Why? Alternative tokens are only needed for the poor developers who have
difficulties entering some characters (&|^~{}[]) due to the limitations of
their environment. I have never seen a recommendation to use them in normal
circumstances, and I would certainly refrain from suggesting their use as a
style rule.

I don't advocating use one or other style. For example, similar decision to use alternative names was made in project I'm working on at the end of 1980s in form of C macros.

Decision to use one or other style should be left for developers of particular project. Check will just help to maintain consistency.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 19, 2015

The question is whether there are projects/teams that are going to benefit from this proposed check.

FWIW, if someone gets to implement this, it seems sensible to implement conversion in both directions (controlled by an option): to alternative tokens and to classic operators.

@EugeneZelenko
Copy link
Contributor Author

*** Bug llvm/llvm-bugzilla-archive#32125 has been marked as a duplicate of this bug. ***

@gnzlbg
Copy link
Mannequin

gnzlbg mannequin commented Mar 9, 2017

I have never seen a recommendation to use them in normal circumstances, and I would certainly refrain from suggesting their use as a style rule.

Some people consider them more readable, and recommend them, for example: http://stackoverflow.com/a/1704050/1422197

No need to share the opinion, but that some people do prefer them is a fact.

@mgehre
Copy link
Contributor

mgehre commented Mar 26, 2017

The other direction of this transformations is now proposed in https://reviews.llvm.org/D31308.

@EugeneZelenko
Copy link
Contributor Author

mentioned in issue llvm/llvm-bugzilla-archive#32125

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@EugeneZelenko EugeneZelenko added the enhancement Improving things as opposed to bug fixing, e.g. new or missing feature label Jan 18, 2022
@PiotrZSL PiotrZSL self-assigned this Feb 22, 2023
@PiotrZSL
Copy link
Member

@PiotrZSL PiotrZSL added the awaiting-review Has pending Phabricator review label Feb 22, 2023
@PiotrZSL PiotrZSL removed the awaiting-review Has pending Phabricator review label Mar 31, 2023
@PiotrZSL
Copy link
Member

Finished by a084854

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy enhancement Improving things as opposed to bug fixing, e.g. new or missing feature
Projects
None yet
Development

No branches or pull requests

4 participants