[clang] [NFC] Fix an incorrect comment about operator precedence. (PR #105784)

Michael Park via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 22:16:00 PDT 2024


https://github.com/mpark created https://github.com/llvm/llvm-project/pull/105784

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

>From 9c90592726137fabbcbc7388b3ce0d4bc496bfc6 Mon Sep 17 00:00:00 2001
From: Michael Park <mcypark at gmail.com>
Date: Thu, 22 Aug 2024 22:14:19 -0700
Subject: [PATCH] [NFC] Fix an incorrect comment about operator precedence.

The comment talks about left-associative operators twice, when
the latter mention is actually describing right-associative operators.
---
 clang/lib/Parse/ParseExpr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.



More information about the cfe-commits mailing list