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

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 10:56:49 PST 2018


juliehockett created this revision.
juliehockett added a reviewer: alexfh.
juliehockett added a project: clang-tools-extra.
Herald added a subscriber: xazax.hun.

Updating Fuchsia overloaded operator warning message for clarity.


https://reviews.llvm.org/D42120

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


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 [fuchsia-overloaded-operator]
 };
 
 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 [fuchsia-overloaded-operator]
   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 [fuchsia-overloaded-operator]
 };
 
 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 [fuchsia-overloaded-operator]
 
 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 [fuchsia-overloaded-operator]
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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42120.129998.patch
Type: text/x-patch
Size: 2013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180116/6523bc6c/attachment.bin>


More information about the cfe-commits mailing list