Skip to content

[NFC] Fix an incorrect comment about operator precedence. #105784

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

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

mpark
Copy link
Member

@mpark mpark commented Aug 23, 2024

The comment talks about left-associative operators twice, when the latter mention is actually describing right-associative operators.

The comment talks about left-associative operators twice, when
the latter mention is actually describing right-associative operators.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Aug 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 23, 2024

@llvm/pr-subscribers-clang

Author: Michael Park (mpark)

Changes

The comment talks about left-associative operators twice, when the latter mention is actually describing right-associative operators.


Full diff: https://github.com/llvm/llvm-project/pull/105784.diff

1 Files Affected:

  • (modified) clang/lib/Parse/ParseExpr.cpp (+1-1)
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 1405aef700bec5..64f284d78b24db 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -607,7 +607,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
         RHS = ExprError();
       }
       // If this is left-associative, only parse things on the RHS that bind
-      // more tightly than the current operator.  If it is left-associative, it
+      // more tightly than the current operator.  If it is right-associative, it
       // is okay, to bind exactly as tightly.  For example, compile A=B=C=D as
       // A=(B=(C=D)), where each paren is a level of recursion here.
       // The function takes ownership of the RHS.

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks (Hi!). Do you have commit access or should I merge that for you?

@mpark
Copy link
Member Author

mpark commented Aug 23, 2024

Thanks (Hi!). Do you have commit access or should I merge that for you?

Hi Corentin! I have commit access 🙂

@mpark mpark merged commit 1821cb3 into llvm:main Aug 23, 2024
11 checks passed
@mpark mpark deleted the fix-op-prec-comment branch August 23, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants