[cfe-commits] r74481 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaType.cpp test/SemaCXX/member-pointer.cpp
Anders Carlsson
andersca at mac.com
Mon Jun 29 17:06:57 PDT 2009
Author: andersca
Date: Mon Jun 29 19:06:57 2009
New Revision: 74481
URL: http://llvm.org/viewvc/llvm-project?rev=74481&view=rev
Log:
Make an error message more clear.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/SemaCXX/member-pointer.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=74481&r1=74480&r2=74481&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Jun 29 19:06:57 2009
@@ -1074,6 +1074,8 @@
"star modifier used outside of function prototype">;
def err_illegal_decl_pointer_to_reference : Error<
"'%0' declared as a pointer to a reference">;
+def err_illegal_decl_mempointer_to_reference : Error<
+ "'%0' declared as a member pointer to a reference">;
def err_illegal_decl_mempointer_to_void : Error<
"'%0' declared as a member pointer to void">;
def err_illegal_decl_mempointer_in_nonclass : Error<
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=74481&r1=74480&r2=74481&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Mon Jun 29 19:06:57 2009
@@ -697,7 +697,7 @@
// C++ 8.3.3p3: A pointer to member shall not pointer to ... a member
// with reference type, or "cv void."
if (T->isReferenceType()) {
- Diag(Loc, diag::err_illegal_decl_pointer_to_reference)
+ Diag(Loc, diag::err_illegal_decl_mempointer_to_reference)
<< (Entity? Entity.getAsString() : "type name");
return QualType();
}
Modified: cfe/trunk/test/SemaCXX/member-pointer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/member-pointer.cpp?rev=74481&r1=74480&r2=74481&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/member-pointer.cpp (original)
+++ cfe/trunk/test/SemaCXX/member-pointer.cpp Mon Jun 29 19:06:57 2009
@@ -16,7 +16,7 @@
// expected-error{{does not point into a class}}
int C::*pci; // expected-error {{'pci' does not point into a class}}
void A::*pdv; // expected-error {{'pdv' declared as a member pointer to void}}
-int& A::*pdr; // expected-error {{'pdr' declared as a pointer to a reference}}
+int& A::*pdr; // expected-error {{'pdr' declared as a member pointer to a reference}}
void f() {
// This requires tentative parsing.
More information about the cfe-commits
mailing list