From 9f6fec4419b3126ab39eaaab935e8995589af1fe Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 2 Jan 2014 23:02:01 +0000 Subject: [PATCH] Removing some more unnecessary manual quotes from attribute diagnostics. llvm-svn: 198371 --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 4 ++-- clang/lib/Sema/SemaDeclAttr.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 1f0a240fe0a9..ae084fddd6b3 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -2019,9 +2019,9 @@ def warn_attribute_invalid_on_definition : Warning< def err_attribute_weakref_not_static : Error< "weakref declaration must have internal linkage">; def err_attribute_weakref_not_global_context : Error< - "weakref declaration of '%0' must be in a global context">; + "weakref declaration of %0 must be in a global context">; def err_attribute_weakref_without_alias : Error< - "weakref declaration of '%0' must also have an alias attribute">; + "weakref declaration of %0 must also have an alias attribute">; def err_alias_not_supported_on_darwin : Error < "only weak aliases are supported on darwin">; def err_alias_to_undefined : Error< diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 8a9806586d90..083a66e25591 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1369,8 +1369,8 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) { // we reject them const DeclContext *Ctx = D->getDeclContext()->getRedeclContext(); if (!Ctx->isFileContext()) { - S.Diag(Attr.getLoc(), diag::err_attribute_weakref_not_global_context) << - nd->getNameAsString(); + S.Diag(Attr.getLoc(), diag::err_attribute_weakref_not_global_context) + << nd; return; } @@ -4127,8 +4127,8 @@ void Sema::ProcessDeclAttributeList(Scope *S, Decl *D, // static int a9 __attribute__((weakref)); // but that looks really pointless. We reject it. if (D->hasAttr() && !D->hasAttr()) { - Diag(AttrList->getLoc(), diag::err_attribute_weakref_without_alias) << - cast(D)->getNameAsString(); + Diag(AttrList->getLoc(), diag::err_attribute_weakref_without_alias) + << cast(D); D->dropAttr(); return; }