aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-20 06:06:08 +0000
committerChris Lattner <sabre@nondot.org>2008-11-20 06:06:08 +0000
commitd3a94e24ddf3fb90de76b17bd176d9ed61e66f2c (patch)
treed55ad18f3559a2da9836895aaf9d80bb33263015 /lib/Sema/SemaDecl.cpp
parent572af49cc0052931e7b06902d99c72f04b75704e (diff)
remove another old-school Diag method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index aa2154f0c6..ad656a351a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -841,16 +841,16 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
//
if (PrevDecl == 0) {
// No previous declaration in the qualifying scope.
- Diag(D.getIdentifierLoc(), diag::err_typecheck_no_member,
- Name.getAsString(), D.getCXXScopeSpec().getRange());
+ Diag(D.getIdentifierLoc(), diag::err_typecheck_no_member)
+ << Name.getAsString() << D.getCXXScopeSpec().getRange();
} else if (!CurContext->Encloses(DC)) {
// The qualifying scope doesn't enclose the original declaration.
// Emit diagnostic based on current scope.
SourceLocation L = D.getIdentifierLoc();
SourceRange R = D.getCXXScopeSpec().getRange();
if (isa<FunctionDecl>(CurContext)) {
- Diag(L, diag::err_invalid_declarator_in_function, Name.getAsString(),
- R);
+ Diag(L, diag::err_invalid_declarator_in_function)
+ << Name.getAsString() << R;
} else {
Diag(L, diag::err_invalid_declarator_scope)
<< Name.getAsString() << cast<NamedDecl>(DC)->getName() << R;
@@ -1808,10 +1808,8 @@ void Sema::ActOnUninitializedDecl(DeclTy *dcl) {
// within its class declaration (9.2), and where the extern
// specifier is explicitly used.
if (Type->isReferenceType() && Var->getStorageClass() != VarDecl::Extern) {
- Diag(Var->getLocation(),
- diag::err_reference_var_requires_init,
- Var->getName(),
- SourceRange(Var->getLocation(), Var->getLocation()));
+ Diag(Var->getLocation(), diag::err_reference_var_requires_init)
+ << Var->getName() << SourceRange(Var->getLocation(), Var->getLocation());
Var->setInvalidDecl();
return;
}