[cfe-commits] r122951 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/SemaCXX/ptrtomember.cpp

Chandler Carruth chandlerc at gmail.com
Wed Jan 5 22:29:28 PST 2011


Author: chandlerc
Date: Thu Jan  6 00:29:28 2011
New Revision: 122951

URL: http://llvm.org/viewvc/llvm-project?rev=122951&view=rev
Log:
Tweak the wording of this warning further based on a suggestion from Chris.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/SemaCXX/ptrtomember.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=122951&r1=122950&r2=122951&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Jan  6 00:29:28 2011
@@ -2770,7 +2770,7 @@
 def err_cannot_form_pointer_to_member_of_reference_type : Error<
   "cannot form a pointer-to-member to member %0 of reference type %1">;
 def err_invalid_use_of_bound_member_func : Error<
-  "a bound member function may only be used to call itself">;
+  "a bound member function may only be called">;
 def err_incomplete_object_call : Error<
   "incomplete type in call to object of type %0">;
 def err_incomplete_pointer_to_member_return : Error<

Modified: cfe/trunk/test/SemaCXX/ptrtomember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ptrtomember.cpp?rev=122951&r1=122950&r2=122951&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/ptrtomember.cpp (original)
+++ cfe/trunk/test/SemaCXX/ptrtomember.cpp Thu Jan  6 00:29:28 2011
@@ -22,11 +22,11 @@
 };
 
 void f3(S3* p, void (S3::*m)()) {
-    p->*m; // expected-error {{a bound member function may only be used to call it}}
-    (void)(p->*m); // expected-error {{a bound member function may only be used to call it}}
-    (void)(void*)(p->*m); // expected-error {{a bound member function may only be used to call it}}
-    (void)reinterpret_cast<void*>(p->*m); // expected-error {{a bound member function may only be used to call it}}
-    if (p->*m) {} // expected-error {{a bound member function may only be used to call it}}
+    p->*m; // expected-error {{a bound member function may only be called}}
+    (void)(p->*m); // expected-error {{a bound member function may only be called}}
+    (void)(void*)(p->*m); // expected-error {{a bound member function may only be called}}
+    (void)reinterpret_cast<void*>(p->*m); // expected-error {{a bound member function may only be called}}
+    if (p->*m) {} // expected-error {{a bound member function may only be called}}
 
-    p->m; // expected-error {{a bound member function may only be used to call it}}
+    p->m; // expected-error {{a bound member function may only be called}}
 }





More information about the cfe-commits mailing list