[PATCH] D42120: [clang-tidy] Fixing Fuchsia overloaded operator warning message

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 09:43:11 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE322692: [clang-tidy] Fixing Fuchsia overloaded operator warning message (authored by juliehockett, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42120?vs=129998&id=130205#toc

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42120

Files:
  clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
  test/clang-tidy/fuchsia-overloaded-operator.cpp


Index: clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
===================================================================
--- clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
+++ clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
@@ -35,7 +35,7 @@
   
   SourceLocation Loc = D->getLocStart();
   if (Loc.isValid())
-    diag(Loc, "cannot overload %0") << D;
+    diag(Loc, "overloading %0 is disallowed") << D;
 }
 
 } // namespace fuchsia
Index: test/clang-tidy/fuchsia-overloaded-operator.cpp
===================================================================
--- test/clang-tidy/fuchsia-overloaded-operator.cpp
+++ test/clang-tidy/fuchsia-overloaded-operator.cpp
@@ -3,19 +3,19 @@
 class A {
 public:
   int operator+(int);
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: cannot overload 'operator+' [fuchsia-overloaded-operator]
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: overloading 'operator+' is disallowed
 };
 
 class B {
 public:
   B &operator=(const B &Other);
-  // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: cannot overload 'operator=' [fuchsia-overloaded-operator]
+  // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: overloading 'operator=' is disallowed
   B &operator=(B &&Other);
-  // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: cannot overload 'operator=' [fuchsia-overloaded-operator]
+  // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: overloading 'operator=' is disallowed
 };
 
 A operator-(const A &A1, const A &A2);
-// CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator-' [fuchsia-overloaded-operator]
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: overloading 'operator-' is disallowed
 
 void operator delete(void*, void*) throw();
-// CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator delete' [fuchsia-overloaded-operator]
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: overloading 'operator delete' is disallowed


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42120.130205.patch
Type: text/x-patch
Size: 1863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180117/74579fb1/attachment.bin>


More information about the cfe-commits mailing list