summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-23 20:28:15 +0000
committerChris Lattner <sabre@nondot.org>2008-11-23 20:28:15 +0000
commitf7e69d5a77b21fd98e29df84411506527faa62b3 (patch)
treef28788136092895a6e81591f405c074886096112 /clang/lib/Sema/SemaDecl.cpp
parentd125393d24b006d67774497d9d284d1e0fee118e (diff)
downloadbcm5719-llvm-f7e69d5a77b21fd98e29df84411506527faa62b3.tar.gz
bcm5719-llvm-f7e69d5a77b21fd98e29df84411506527faa62b3.zip
add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString(). This implicitly puts quotes around the name, so diagnostics need to be tweaked to accommodate this. llvm-svn: 59916
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ef24d1a34a8..fba9f3328b1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -856,10 +856,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
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 << R;
} else {
- Diag(L, diag::err_invalid_declarator_scope)
+ Diag(L, diag::err_invalid_declarator_scope)
<< Name.getAsString() << cast<NamedDecl>(DC)->getName() << R;
}
}
OpenPOWER on IntegriCloud