From 4d297c3719e3c3725a50d03c4f26cfcfdb052cf5 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 2 Jan 2014 23:15:58 +0000 Subject: [PATCH] Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198372 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 4 ++-- lib/Sema/SemaDeclAttr.cpp | 4 ++-- test/SemaCXX/warn-thread-safety-parsing.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index ae084fddd6..7ad21d6146 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2115,11 +2115,11 @@ def warn_thread_attribute_ignored : Warning< InGroup, DefaultIgnore; def warn_thread_attribute_argument_not_lockable : Warning< "%0 attribute requires arguments whose type is annotated " - "with 'lockable' attribute; type here is '%1'">, + "with 'lockable' attribute; type here is %1">, InGroup, DefaultIgnore; def warn_thread_attribute_argument_not_class : Warning< "%0 attribute requires arguments that are class type or point to" - " class type; type here is '%1'">, + " class type; type here is %1">, InGroup, DefaultIgnore; def warn_thread_attribute_decl_not_lockable : Warning< "%0 attribute can only be applied in a context annotated " diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 083a66e255..ff91346240 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -430,7 +430,7 @@ static void checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr, // Warn if could not get record type for this argument. if (!RT) { S.Diag(Attr.getLoc(), diag::warn_thread_attribute_argument_not_class) - << Attr.getName() << Ty.getAsString(); + << Attr.getName() << Ty; return; } @@ -456,7 +456,7 @@ static void checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr, } S.Diag(Attr.getLoc(), diag::warn_thread_attribute_argument_not_lockable) - << Attr.getName() << Ty.getAsString(); + << Attr.getName() << Ty; } /// \brief Thread Safety Analysis: Checks that all attribute arguments, starting diff --git a/test/SemaCXX/warn-thread-safety-parsing.cpp b/test/SemaCXX/warn-thread-safety-parsing.cpp index c221f1b353..f672d690b0 100644 --- a/test/SemaCXX/warn-thread-safety-parsing.cpp +++ b/test/SemaCXX/warn-thread-safety-parsing.cpp @@ -357,9 +357,9 @@ int gb_var_arg_bad_1 GUARDED_BY(1); // \ int gb_var_arg_bad_2 GUARDED_BY("mu"); // \ // expected-warning {{ignoring 'guarded_by' attribute because its argument is invalid}} int gb_var_arg_bad_3 GUARDED_BY(muDoublePointer); // \ - // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'class Mutex **'}} + // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'Mutex **'}} int gb_var_arg_bad_4 GUARDED_BY(umu); // \ - // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute; type here is 'class UnlockableMu'}} + // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute; type here is 'UnlockableMu'}} //3. // Thread Safety analysis tests @@ -1430,7 +1430,7 @@ class Foo { int a GUARDED_BY(mu1_); int b GUARDED_BY(mu2_); int c GUARDED_BY(mu3_); // \ - // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute; type here is 'class InheritanceTest::Derived3'}} + // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute; type here is 'InheritanceTest::Derived3'}} void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1_, mu2_) { a = 0; -- 2.49.0