aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-12-06 20:05:35 +0000
committerAnders Carlsson <andersca@mac.com>2008-12-06 20:05:35 +0000
commita75023d60fc22cef8c5c0e6ea79758233f4d2e2d (patch)
tree1312921302cfa8d35f10e2719524d02d8f26fea1
parent77e14bd3a714be42dbe1ab90a37b5832740b6df2 (diff)
Simplify some diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60626 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticKinds.def8
-rw-r--r--lib/Sema/SemaDeclCXX.cpp14
2 files changed, 11 insertions, 11 deletions
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index 0205789bd8..0fcc4d9385 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -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")
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index ab8ae72427..bedf3f7d6b 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -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;
}
}