]> granicus.if.org Git - clang/commitdiff
Simplify some diagnostics.
authorAnders Carlsson <andersca@mac.com>
Sat, 6 Dec 2008 20:05:35 +0000 (20:05 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 6 Dec 2008 20:05:35 +0000 (20:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60626 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticKinds.def
lib/Sema/SemaDeclCXX.cpp

index 0205789bd8326a031178faf42ddc0bbd9f701e1d..0fcc4d9385b947d42dcbefe1d19a20e6f1734679 100644 (file)
@@ -734,13 +734,13 @@ DIAG(err_mutable_nonmember, ERROR,
 DIAG(err_virtual_non_function, ERROR,
      "'virtual' can only appear on non-static member functions")
 DIAG(err_not_bitfield_type, ERROR,
-     "cannot declare '%0' to be a bit-field type")
+     "cannot declare %0 to be a bit-field type")
 DIAG(err_static_not_bitfield, ERROR,
-     "static member '%0' cannot be a bit-field")
+     "static member %0 cannot be a bit-field")
 DIAG(err_not_integral_type_bitfield, ERROR,
-     "bit-field '%0' with non-integral type")
+     "bit-field %0 with non-integral type")
 DIAG(err_member_initialization, ERROR,
-    "'%0' can only be initialized if it is a static const integral data member")
+    "%0 can only be initialized if it is a static const integral data member")
 DIAG(err_implicit_object_parameter_init, ERROR,
      "cannot initialize object parameter of type %0 with an expression of type %1")
 
index ab8ae724276d008900d100191c2304b9785dbd4a..bedf3f7d6b66dcadaacb03677e029fcb1854dfb8 100644 (file)
@@ -525,14 +525,14 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
       // FIXME: Emit diagnostic about only constructors taking base initializers
       // or something similar, when constructor support is in place.
       Diag(Loc, diag::err_not_bitfield_type)
-        << Name.getAsString() << BitWidth->getSourceRange();
+        << Name << BitWidth->getSourceRange();
       InvalidDecl = true;
 
     } else if (isInstField) {
       // C++ 9.6p3: A bit-field shall have integral or enumeration type.
       if (!cast<FieldDecl>(Member)->getType()->isIntegralType()) {
         Diag(Loc, diag::err_not_integral_type_bitfield)
-          << Name.getAsString() << BitWidth->getSourceRange();
+          << Name << BitWidth->getSourceRange();
         InvalidDecl = true;
       }
 
@@ -540,13 +540,13 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
       // A function typedef ("typedef int f(); f a;").
       // C++ 9.6p3: A bit-field shall have integral or enumeration type.
       Diag(Loc, diag::err_not_integral_type_bitfield)
-        << Name.getAsString() << BitWidth->getSourceRange();
+        << Name << BitWidth->getSourceRange();
       InvalidDecl = true;
 
     } else if (isa<TypedefDecl>(Member)) {
       // "cannot declare 'A' to be a bit-field type"
       Diag(Loc, diag::err_not_bitfield_type)
-        << Name.getAsString() << BitWidth->getSourceRange();
+        << Name << BitWidth->getSourceRange();
       InvalidDecl = true;
 
     } else {
@@ -555,7 +555,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
       // C++ 9.6p3: A bit-field shall not be a static member.
       // "static member 'A' cannot be a bit-field"
       Diag(Loc, diag::err_static_not_bitfield)
-        << Name.getAsString() << BitWidth->getSourceRange();
+        << Name << BitWidth->getSourceRange();
       InvalidDecl = true;
     }
   }
@@ -577,14 +577,14 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
       } else {
         // not const integral.
         Diag(Loc, diag::err_member_initialization)
-          << Name.getAsString() << Init->getSourceRange();
+          << Name << Init->getSourceRange();
         InvalidDecl = true;
       }
 
     } else {
       // not static member.
       Diag(Loc, diag::err_member_initialization)
-        << Name.getAsString() << Init->getSourceRange();
+        << Name << Init->getSourceRange();
       InvalidDecl = true;
     }
   }