[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-19 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 created this revision.
AMP999 added reviewers: clang, rsmith.
AMP999 added a project: clang.
Herald added a project: All.
AMP999 requested review of this revision.
Herald added a subscriber: cfe-commits.

https://godbolt.org/z/cMKE3o1aG

According to the issue https://github.com/llvm/llvm-project/issues/63960 , 
compiler falsely complains that no viable `operator<=>` was found while we are 
actually looking for a `operator==`.
This bug has been fixed through adding a check of the `OverloadedOperatorKind` 
type's object, `OO`, to see if it is `OO_EqualEqual` in addition to 
`OO_ExclaimEqual`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155714

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
  clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
  clang/test/CXX/class/class.compare/class.eq/p2.cpp
  clang/test/CXX/class/class.compare/class.spaceship/p1.cpp


Index: clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
+++ clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
@@ -80,7 +80,7 @@
   // expected-note@#base {{deleted comparison function for base class 'C'}}
   // expected-note@#base {{no viable three-way comparison function for base 
class 'D1'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#base {{no viable three-way comparison function for base 
class 'D2'}}
+  // expected-note@#base {{no viable 'operator==' for base class 'D2'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#base {{deleted comparison function for base class 'E'}}
   // expected-note@#base {{implied comparison for base class 'F' is ambiguous}}
@@ -112,7 +112,7 @@
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
+  // expected-note@#arr {{no viable 'operator==' for member 'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{implied comparison for member 'arr' is ambiguous}}
Index: clang/test/CXX/class/class.compare/class.eq/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.eq/p2.cpp
+++ clang/test/CXX/class/class.compare/class.eq/p2.cpp
@@ -37,7 +37,7 @@
 template struct X {
   X();
   bool operator==(const X&) const = default; // #x expected-note 4{{deleted 
here}}
-  T t; // expected-note 3{{because there is no viable three-way comparison 
function for member 't'}}
+  T t; // expected-note 3{{because there is no viable 'operator==' for member 
't'}}
// expected-note@-1 {{because it would invoke a deleted comparison 
function for member 't'}}
 };
 
Index: clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
+++ clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
@@ -5,6 +5,14 @@
   // expected-note@-1 {{defaulted 'operator!=' is implicitly deleted because 
there is no viable 'operator==' for 'A'}}
 };
 
+struct A2 {
+  struct E {};
+  E e;
+  bool operator==(const A2&) const = default; // expected-warning {{explicitly 
defaulted equality comparison operator is implicitly deleted}} 
expected-note{{replace 'default'}}
+  // expected-note@-2 {{defaulted 'operator==' is implicitly deleted because 
there is no viable 'operator==' for member 'e'}}
+};
+
+
 struct Q {};
 bool operator!=(Q, Q); // expected-note {{defaulted 'operator!=' is implicitly 
deleted because this non-rewritten comparison function would be the best match 
for the comparison}}
 struct B {
Index: clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
+++ clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
@@ -100,7 +100,7 @@
   struct Q {
 struct X {
   friend std::strong_ordering operator<=>(const X&, const X&);
-} x; // expected-note {{no viable three-way comparison}}
+} x; // expected-note {{no viable 'operator=='}}
 // expected-error@+1 {{defau

[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-19 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 updated this revision to Diff 542136.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155714/new/

https://reviews.llvm.org/D155714

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
  clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
  clang/test/CXX/class/class.compare/class.eq/p2.cpp
  clang/test/CXX/class/class.compare/class.spaceship/p1.cpp


Index: clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
+++ clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
@@ -80,7 +80,7 @@
   // expected-note@#base {{deleted comparison function for base class 'C'}}
   // expected-note@#base {{no viable three-way comparison function for base 
class 'D1'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#base {{no viable three-way comparison function for base 
class 'D2'}}
+  // expected-note@#base {{no viable 'operator==' for base class 'D2'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#base {{deleted comparison function for base class 'E'}}
   // expected-note@#base {{implied comparison for base class 'F' is ambiguous}}
@@ -112,7 +112,7 @@
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
+  // expected-note@#arr {{no viable 'operator==' for member 'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{implied comparison for member 'arr' is ambiguous}}
Index: clang/test/CXX/class/class.compare/class.eq/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.eq/p2.cpp
+++ clang/test/CXX/class/class.compare/class.eq/p2.cpp
@@ -37,7 +37,7 @@
 template struct X {
   X();
   bool operator==(const X&) const = default; // #x expected-note 4{{deleted 
here}}
-  T t; // expected-note 3{{because there is no viable three-way comparison 
function for member 't'}}
+  T t; // expected-note 3{{because there is no viable 'operator==' for member 
't'}}
// expected-note@-1 {{because it would invoke a deleted comparison 
function for member 't'}}
 };
 
Index: clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
+++ clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
@@ -5,6 +5,14 @@
   // expected-note@-1 {{defaulted 'operator!=' is implicitly deleted because 
there is no viable 'operator==' for 'A'}}
 };
 
+struct A2 {
+  struct E {};
+  E e;
+  bool operator==(const A2&) const = default; // expected-warning {{explicitly 
defaulted equality comparison operator is implicitly deleted}} 
expected-note{{replace 'default'}}
+  // expected-note@-2 {{defaulted 'operator==' is implicitly deleted because 
there is no viable 'operator==' for member 'e'}}
+};
+
+
 struct Q {};
 bool operator!=(Q, Q); // expected-note {{defaulted 'operator!=' is implicitly 
deleted because this non-rewritten comparison function would be the best match 
for the comparison}}
 struct B {
Index: clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
+++ clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
@@ -100,7 +100,7 @@
   struct Q {
 struct X {
   friend std::strong_ordering operator<=>(const X&, const X&);
-} x; // expected-note {{no viable three-way comparison}}
+} x; // expected-note {{no viable 'operator=='}}
 // expected-error@+1 {{defaulting the corresponding implicit 'operator==' 
for this defaulted 'operator<=>' would delete it after its first declaration}}
 friend std::strong_ordering operator<=>(const Q&, const Q&) = default;
   };
Index: clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
+++ clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
@@ -153,7 +1

[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-19 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 updated this revision to Diff 542240.
AMP999 added a comment.

Revised the formatting of the change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155714/new/

https://reviews.llvm.org/D155714

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
  clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
  clang/test/CXX/class/class.compare/class.eq/p2.cpp
  clang/test/CXX/class/class.compare/class.spaceship/p1.cpp


Index: clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
+++ clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
@@ -80,7 +80,7 @@
   // expected-note@#base {{deleted comparison function for base class 'C'}}
   // expected-note@#base {{no viable three-way comparison function for base 
class 'D1'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#base {{no viable three-way comparison function for base 
class 'D2'}}
+  // expected-note@#base {{no viable 'operator==' for base class 'D2'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#base {{deleted comparison function for base class 'E'}}
   // expected-note@#base {{implied comparison for base class 'F' is ambiguous}}
@@ -112,7 +112,7 @@
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '<' comparison}}
-  // expected-note@#arr {{no viable three-way comparison function for member 
'arr'}}
+  // expected-note@#arr {{no viable 'operator==' for member 'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because 
there is no viable function for '==' comparison}}
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{implied comparison for member 'arr' is ambiguous}}
Index: clang/test/CXX/class/class.compare/class.eq/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.eq/p2.cpp
+++ clang/test/CXX/class/class.compare/class.eq/p2.cpp
@@ -37,7 +37,7 @@
 template struct X {
   X();
   bool operator==(const X&) const = default; // #x expected-note 4{{deleted 
here}}
-  T t; // expected-note 3{{because there is no viable three-way comparison 
function for member 't'}}
+  T t; // expected-note 3{{because there is no viable 'operator==' for member 
't'}}
// expected-note@-1 {{because it would invoke a deleted comparison 
function for member 't'}}
 };
 
Index: clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
+++ clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
@@ -5,6 +5,14 @@
   // expected-note@-1 {{defaulted 'operator!=' is implicitly deleted because 
there is no viable 'operator==' for 'A'}}
 };
 
+struct A2 {
+  struct E {};
+  E e;
+  bool operator==(const A2&) const = default; // expected-warning {{explicitly 
defaulted equality comparison operator is implicitly deleted}} 
expected-note{{replace 'default'}}
+  // expected-note@-2 {{defaulted 'operator==' is implicitly deleted because 
there is no viable 'operator==' for member 'e'}}
+};
+
+
 struct Q {};
 bool operator!=(Q, Q); // expected-note {{defaulted 'operator!=' is implicitly 
deleted because this non-rewritten comparison function would be the best match 
for the comparison}}
 struct B {
Index: clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
+++ clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
@@ -100,7 +100,7 @@
   struct Q {
 struct X {
   friend std::strong_ordering operator<=>(const X&, const X&);
-} x; // expected-note {{no viable three-way comparison}}
+} x; // expected-note {{no viable 'operator=='}}
 // expected-error@+1 {{defaulting the corresponding implicit 'operator==' 
for this defaulted 'operator<=>' would delete it after its first declaration}}
 friend std::strong_ordering operator<=>(const Q&, const Q&) = default;
   };
Index: clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
+++ clang/test/C

[PATCH] D155814: Fix the linting problems which caused `clang/utils/ci/run-buildbot check-format` to return 1.

2023-07-20 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 created this revision.
AMP999 added a reviewer: clang.
AMP999 added a project: clang.
Herald added a reviewer: NoQ.
Herald added a project: All.
AMP999 requested review of this revision.
Herald added a subscriber: cfe-commits.

`clang/utils/ci/run-buildbot check-format` command in build process caused my 
last differential, https://reviews.llvm.org/D155714, to fail 
(https://buildkite.com/llvm-project/clang-ci/builds/355) and when I checked the 
logs and found out that the problem doesn't reside in my change. So I fixed the 
linting problem in the `clang/lib/Analysis/UnsafeBufferUsage.cpp` file which is 
to remove some redundant white spaces.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155814

Files:
  clang/lib/Analysis/UnsafeBufferUsage.cpp


Index: clang/lib/Analysis/UnsafeBufferUsage.cpp
===
--- clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1890,10 +1890,10 @@
   const ParmVarDecl *Parm = FD->getParamDecl(i);
 
   if (Parm->isImplicit())
-continue;  
+continue;
   // FIXME: If a parameter has no name, it is unused in the
   // definition. So we could just leave it as it is.
-  if (!Parm->getIdentifier()) 
+  if (!Parm->getIdentifier())
// If a parameter of a function definition has no name:
 return std::nullopt;
   if (i == ParmIdx)


Index: clang/lib/Analysis/UnsafeBufferUsage.cpp
===
--- clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1890,10 +1890,10 @@
   const ParmVarDecl *Parm = FD->getParamDecl(i);
 
   if (Parm->isImplicit())
-continue;  
+continue;
   // FIXME: If a parameter has no name, it is unused in the
   // definition. So we could just leave it as it is.
-  if (!Parm->getIdentifier()) 
+  if (!Parm->getIdentifier())
 	// If a parameter of a function definition has no name:
 return std::nullopt;
   if (i == ParmIdx)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-21 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 updated this revision to Diff 542909.
AMP999 added a comment.

An entry added to clang/docs/ReleaseNotes.rst
Thank You for the review!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155714/new/

https://reviews.llvm.org/D155714

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
  clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
  clang/test/CXX/class/class.compare/class.eq/p2.cpp
  clang/test/CXX/class/class.compare/class.spaceship/p1.cpp

Index: clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
===
--- clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
+++ clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
@@ -80,7 +80,7 @@
   // expected-note@#base {{deleted comparison function for base class 'C'}}
   // expected-note@#base {{no viable three-way comparison function for base class 'D1'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because there is no viable function for '<' comparison}}
-  // expected-note@#base {{no viable three-way comparison function for base class 'D2'}}
+  // expected-note@#base {{no viable 'operator==' for base class 'D2'}}
   // expected-note@#base {{three-way comparison cannot be synthesized because there is no viable function for '==' comparison}}
   // expected-note@#base {{deleted comparison function for base class 'E'}}
   // expected-note@#base {{implied comparison for base class 'F' is ambiguous}}
@@ -112,7 +112,7 @@
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{no viable three-way comparison function for member 'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because there is no viable function for '<' comparison}}
-  // expected-note@#arr {{no viable three-way comparison function for member 'arr'}}
+  // expected-note@#arr {{no viable 'operator==' for member 'arr'}}
   // expected-note@#arr {{three-way comparison cannot be synthesized because there is no viable function for '==' comparison}}
   // expected-note@#arr {{deleted comparison function for member 'arr'}}
   // expected-note@#arr {{implied comparison for member 'arr' is ambiguous}}
Index: clang/test/CXX/class/class.compare/class.eq/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.eq/p2.cpp
+++ clang/test/CXX/class/class.compare/class.eq/p2.cpp
@@ -37,7 +37,7 @@
 template struct X {
   X();
   bool operator==(const X&) const = default; // #x expected-note 4{{deleted here}}
-  T t; // expected-note 3{{because there is no viable three-way comparison function for member 't'}}
+  T t; // expected-note 3{{because there is no viable 'operator==' for member 't'}}
// expected-note@-1 {{because it would invoke a deleted comparison function for member 't'}}
 };
 
Index: clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
+++ clang/test/CXX/class/class.compare/class.compare.secondary/p2.cpp
@@ -5,6 +5,14 @@
   // expected-note@-1 {{defaulted 'operator!=' is implicitly deleted because there is no viable 'operator==' for 'A'}}
 };
 
+struct A2 {
+  struct E {};
+  E e;
+  bool operator==(const A2&) const = default; // expected-warning {{explicitly defaulted equality comparison operator is implicitly deleted}} expected-note{{replace 'default'}}
+  // expected-note@-2 {{defaulted 'operator==' is implicitly deleted because there is no viable 'operator==' for member 'e'}}
+};
+
+
 struct Q {};
 bool operator!=(Q, Q); // expected-note {{defaulted 'operator!=' is implicitly deleted because this non-rewritten comparison function would be the best match for the comparison}}
 struct B {
Index: clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
===
--- clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
+++ clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
@@ -100,7 +100,7 @@
   struct Q {
 struct X {
   friend std::strong_ordering operator<=>(const X&, const X&);
-} x; // expected-note {{no viable three-way comparison}}
+} x; // expected-note {{no viable 'operator=='}}
 // expected-error@+1 {{defaulting the corresponding implicit 'operator==' for this defaulted 'operator<=>' would delete it after its first declaration}}
 friend std::strong_ordering operator<=>(const Q&, const Q&) = default;
   };
Index: clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
===
--- clang/test/CXX/class/class.compare/c

[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-21 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

I appreciate if you take a look at another patch I sent to address the ci build 
failure when calling `clang/utils/ci/run-buildbot check-format` caused by some 
extra white spaces. 
https://reviews.llvm.org/D155814


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155714/new/

https://reviews.llvm.org/D155714

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155714: [clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.

2023-07-21 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

By the way I don't have permissions to commit so I'll send you my name and 
email:
Name: Amirreza Ashouri
Email: ar.ashouri...@gmail.com


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155714/new/

https://reviews.llvm.org/D155714

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155814: Fix the linting problems which causes `clang/utils/ci/run-buildbot check-format` to return 1.

2023-07-21 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 updated this revision to Diff 542972.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155814/new/

https://reviews.llvm.org/D155814

Files:
  clang/lib/Analysis/UnsafeBufferUsage.cpp


Index: clang/lib/Analysis/UnsafeBufferUsage.cpp
===
--- clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1889,11 +1889,11 @@
   const ParmVarDecl *Parm = FD->getParamDecl(i);
 
   if (Parm->isImplicit())
-continue;  
+continue;
   // FIXME: If a parameter has no name, it is unused in the
   // definition. So we could just leave it as it is.
-  if (!Parm->getIdentifier()) 
-   // If a parameter of a function definition has no name:
+  if (!Parm->getIdentifier())
+// If a parameter of a function definition has no name:
 return std::nullopt;
   if (i == ParmIdx)
 // This is our spanified paramter!
@@ -2208,7 +2208,6 @@
UnsafeBufferUsageHandler &Handler,
bool EmitSuggestions) {
   assert(D && D->getBody());
-  
   // We do not want to visit a Lambda expression defined inside a method 
independently.
   // Instead, it should be visited along with the outer method.
   if (const auto *fd = dyn_cast(D)) {


Index: clang/lib/Analysis/UnsafeBufferUsage.cpp
===
--- clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1889,11 +1889,11 @@
   const ParmVarDecl *Parm = FD->getParamDecl(i);
 
   if (Parm->isImplicit())
-continue;  
+continue;
   // FIXME: If a parameter has no name, it is unused in the
   // definition. So we could just leave it as it is.
-  if (!Parm->getIdentifier()) 
-	// If a parameter of a function definition has no name:
+  if (!Parm->getIdentifier())
+// If a parameter of a function definition has no name:
 return std::nullopt;
   if (i == ParmIdx)
 // This is our spanified paramter!
@@ -2208,7 +2208,6 @@
UnsafeBufferUsageHandler &Handler,
bool EmitSuggestions) {
   assert(D && D->getBody());
-  
   // We do not want to visit a Lambda expression defined inside a method independently.
   // Instead, it should be visited along with the outer method.
   if (const auto *fd = dyn_cast(D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151625: [clang] Add `clang::equality_operator_compares_members_lexicographically`

2023-07-24 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

This attribute is trying to work around an issue with operator== instantiation, 
but according to 
https://cpplang.slack.com/archives/C6K47F8TT/p1689107603335019?thread_ts=1689107603.335019&cid=C6K47F8TT
 the problem is actually a bug in Clang. Shouldn't the Clang bug be fixed 
instead, so that this attribute won't be needed?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151625/new/

https://reviews.llvm.org/D151625

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155814: Fix the linting problems which causes `clang/utils/ci/run-buildbot check-format` to return 1.

2023-07-24 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

You're welcome!
I don't have permission to commit so I'll send my Name and Email:
Name: Amirreza Ashouri
Email: ar.ashouri...@gmail.com


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155814/new/

https://reviews.llvm.org/D155814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155814: Fix the linting problems which causes `clang/utils/ci/run-buildbot check-format` to return 1.

2023-07-25 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added subscribers: gmail.com, Google.com.
AMP999 added a comment.

BTW my Email in one of my previous patches is inserted incorrectly. I 
appreciate if you could possibly fix that for me.
my Email in this 0fd4175907b40fe63131482c162d7e0f76000521 
 commit, 
is inserted @google.com instead of @gmail.com.
Thank You!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155814/new/

https://reviews.llvm.org/D155814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151625: [clang] Add `clang::equality_operator_compares_members_lexicographically`

2023-07-26 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

Sure, I just filed this as a GitHub issue in the following link: 
https://github.com/llvm/llvm-project/issues/64124


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151625/new/

https://reviews.llvm.org/D151625

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155814: Fix the linting problems which causes `clang/utils/ci/run-buildbot check-format` to return 1.

2023-08-01 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

Hi @ziqingluo-90 !
I don't have commit privileges, could you commit this for me?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155814/new/

https://reviews.llvm.org/D155814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155814: Fix the linting problems which causes `clang/utils/ci/run-buildbot check-format` to return 1.

2023-08-02 Thread Amirreza Ashouri via Phabricator via cfe-commits
AMP999 added a comment.

Thank You @ziqingluo-90!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155814/new/

https://reviews.llvm.org/D155814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits