[cfe-commits] r60626 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/SemaDeclCXX.cpp

Anders Carlsson andersca at mac.com
Sat Dec 6 12:05:36 PST 2008


Author: andersca
Date: Sat Dec  6 14:05:35 2008
New Revision: 60626

URL: http://llvm.org/viewvc/llvm-project?rev=60626&view=rev
Log:
Simplify some diagnostics.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticKinds.def
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=60626&r1=60625&r2=60626&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Sat Dec  6 14:05:35 2008
@@ -734,13 +734,13 @@
 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")
 

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=60626&r1=60625&r2=60626&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Dec  6 14:05:35 2008
@@ -525,14 +525,14 @@
       // 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 @@
       // 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 @@
       // 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 @@
       } 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;
     }
   }





More information about the cfe-commits mailing list