Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 186980)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -1790,6 +1790,9 @@
 def err_attribute_argument_n_type : Error<
   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
   "constant|a string|an identifier}2">;
+def err_attribute_argument_type : Error<
+  "%0 attribute requires %select{int or bool|an integer "
+  "constant|a string|an identifier}1">;
 def err_attribute_argument_outof_range : Error<
   "init_priority attribute requires integer constant between "
   "101 and 65535 inclusive">;
@@ -1853,8 +1856,6 @@
   "field may not be qualified with an address space">;
 def err_attr_objc_ownership_redundant : Error<
   "the type %0 is already explicitly ownership-qualified">;
-def err_attribute_not_string : Error<
-  "argument to %0 attribute was not a string literal">;
 def err_undeclared_nsnumber : Error<
   "NSNumber must be available to use Objective-C literals">;
 def err_invalid_nsnumber_type : Error<
Index: lib/Sema/SemaDeclAttr.cpp
===================================================================
--- lib/Sema/SemaDeclAttr.cpp	(revision 186980)
+++ lib/Sema/SemaDeclAttr.cpp	(working copy)
@@ -1571,8 +1571,8 @@
   StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
 
   if (!Str || !Str->isAscii()) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_type)
-      << Attr.getName() << 1 << ArgumentString;
+    S.Diag(Attr.getLoc(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
@@ -1694,7 +1694,8 @@
 
   // Check that it is a string.
   if (!Str) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_not_string) << "tls_model";
+    S.Diag(Attr.getLoc(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
@@ -2072,8 +2073,8 @@
   if (NumArgs == 1) {
     StringLiteral *SE = dyn_cast<StringLiteral>(Attr.getArg(0));
     if (!SE) {
-      S.Diag(Attr.getArg(0)->getLocStart(), diag::err_attribute_not_string)
-        << Attr.getName();
+      S.Diag(Attr.getArg(0)->getLocStart(), diag::err_attribute_argument_type)
+        << Attr.getName() << ArgumentString;
       return;
     }
     Str = SE->getString();
@@ -2402,8 +2403,8 @@
   StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
 
   if (!Str || !Str->isAscii()) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_type)
-      << Attr.getName() << 1 << ArgumentString;
+    S.Diag(Attr.getLoc(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
@@ -2894,7 +2895,8 @@
   Expr *ArgExpr = Attr.getArg(0);
   StringLiteral *SE = dyn_cast<StringLiteral>(ArgExpr);
   if (!SE) {
-    S.Diag(ArgExpr->getLocStart(), diag::err_attribute_not_string) << "section";
+    S.Diag(ArgExpr->getLocStart(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
@@ -3434,7 +3436,8 @@
   // Make sure that there is a string literal as the annotation's single
   // argument.
   if (!SE) {
-    S.Diag(ArgExpr->getLocStart(), diag::err_attribute_not_string) <<"annotate";
+    S.Diag(ArgExpr->getLocStart(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
@@ -4117,8 +4120,8 @@
     Expr *Arg = attr.getArg(0);
     StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
     if (!Str || !Str->isAscii()) {
-      Diag(attr.getLoc(), diag::err_attribute_argument_n_type)
-        << attr.getName() << 1 << ArgumentString;
+      Diag(attr.getLoc(), diag::err_attribute_argument_type) << attr.getName()
+        << ArgumentString;
       attr.setInvalid();
       return true;
     }
@@ -4675,8 +4678,8 @@
   Expr *Arg = Attr.getArg(0);
   StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
   if (!Str || !Str->isAscii()) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_type)
-      << Attr.getName() << 1 << ArgumentString;
+    S.Diag(Attr.getLoc(), diag::err_attribute_argument_type)
+      << Attr.getName() << ArgumentString;
     return;
   }
 
Index: lib/Sema/SemaType.cpp
===================================================================
--- lib/Sema/SemaType.cpp	(revision 186980)
+++ lib/Sema/SemaType.cpp	(working copy)
@@ -3937,8 +3937,8 @@
     AttrLoc = S.getSourceManager().getImmediateExpansionRange(AttrLoc).first;
 
   if (!attr.getParameterName()) {
-    S.Diag(AttrLoc, diag::err_attribute_argument_n_type)
-      << attr.getName() << 1 << 2 /*string*/;
+    S.Diag(AttrLoc, diag::err_attribute_argument_type)
+      << attr.getName() << 2 /*string*/;
     attr.setInvalid();
     return true;
   }
@@ -4073,8 +4073,8 @@
 
   // Check the attribute arguments.
   if (!attr.getParameterName()) {
-    S.Diag(attr.getLoc(), diag::err_attribute_argument_n_type)
-      << attr.getName() << 1 << 2 /*string*/;
+    S.Diag(attr.getLoc(), diag::err_attribute_argument_type)
+      << attr.getName() << 2 /*string*/;
     attr.setInvalid();
     return true;
   }
Index: test/Parser/MicrosoftExtensions.cpp
===================================================================
--- test/Parser/MicrosoftExtensions.cpp	(revision 186979)
+++ test/Parser/MicrosoftExtensions.cpp	(working copy)
@@ -4,21 +4,21 @@
 [repeatable][source_annotation_attribute( Parameter|ReturnValue )]
 struct SA_Post{ SA_Post(); int attr; };
 
-[returnvalue:SA_Post( attr=1)] 
+[returnvalue:SA_Post( attr=1)]
 int foo1([SA_Post(attr=1)] void *param);
 
 namespace {
-  [returnvalue:SA_Post(attr=1)] 
+  [returnvalue:SA_Post(attr=1)]
   int foo2([SA_Post(attr=1)] void *param);
 }
 
 class T {
-  [returnvalue:SA_Post(attr=1)] 
+  [returnvalue:SA_Post(attr=1)]
   int foo3([SA_Post(attr=1)] void *param);
 };
 
 extern "C" {
-  [returnvalue:SA_Post(attr=1)] 
+  [returnvalue:SA_Post(attr=1)]
   int foo5([SA_Post(attr=1)] void *param);
 }
 
@@ -32,7 +32,7 @@
 
 
 void uuidof_test1()
-{  
+{
   __uuidof(0);  // expected-error {{you need to include <guiddef.h> before using the '__uuidof' operator}}
 }
 
@@ -44,8 +44,8 @@
     unsigned char  Data4[8];
 } GUID;
 
-struct __declspec(uuid(L"00000000-0000-0000-1234-000000000047")) uuid_attr_bad1 { };// expected-error {{'uuid' attribute requires parameter 1 to be a string}}
-struct __declspec(uuid(3)) uuid_attr_bad2 { };// expected-error {{'uuid' attribute requires parameter 1 to be a string}}
+struct __declspec(uuid(L"00000000-0000-0000-1234-000000000047")) uuid_attr_bad1 { };// expected-error {{'uuid' attribute requires a string}}
+struct __declspec(uuid(3)) uuid_attr_bad2 { };// expected-error {{'uuid' attribute requires a string}}
 struct __declspec(uuid("0000000-0000-0000-1234-0000500000047")) uuid_attr_bad3 { };// expected-error {{uuid attribute contains a malformed GUID}}
 struct __declspec(uuid("0000000-0000-0000-Z234-000000000047")) uuid_attr_bad4 { };// expected-error {{uuid attribute contains a malformed GUID}}
 struct __declspec(uuid("000000000000-0000-1234-000000000047")) uuid_attr_bad5 { };// expected-error {{uuid attribute contains a malformed GUID}}
@@ -59,7 +59,7 @@
 struct __declspec(uuid("000000A0-0000-0000-C000-000000000049"))
 struct_with_uuid2;
 
-struct 
+struct
 struct_with_uuid2 {} ;
 
 int uuid_sema_test()
@@ -89,7 +89,7 @@
 void template_uuid()
 {
    T expr;
-   
+
    __uuidof(T);
    __uuidof(expr);
 }
@@ -113,7 +113,7 @@
   struct __declspec(uuid("000000A0-0000-0000-C000-000000000049")) late_defined_uuid;
 
 
-class CtorCall { 
+class CtorCall {
 public:
   CtorCall& operator=(const CtorCall& that);
 
@@ -136,7 +136,7 @@
   class Iterator {
   };
 };
- 
+
 template<class T>
 class C2  {
   typename C1<T>:: /*template*/  Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}}
@@ -160,7 +160,7 @@
    typename AAAA a;// expected-warning {{expected a qualified name after 'typename'}}
 
    t = 3;
-   
+
    typedef typename T* pointerT;// expected-warning {{expected a qualified name after 'typename'}}
    typedef typename SimpleTemplate<int> templateT;// expected-warning {{expected a qualified name after 'typename'}}
 
@@ -239,25 +239,25 @@
 int __if_exists_init_list() {
 
   int array1[] = {
-    0, 
+    0,
     __if_exists(IF_EXISTS::Type) {2, }
     3
   };
 
   int array2[] = {
-    0, 
+    0,
     __if_exists(IF_EXISTS::Type_not) { this wont compile }
     3
   };
 
   int array3[] = {
-    0, 
+    0,
     __if_not_exists(IF_EXISTS::Type_not) {2, }
     3
   };
 
   int array4[] = {
-    0, 
+    0,
     __if_not_exists(IF_EXISTS::Type) { this wont compile }
     3
   };
@@ -300,7 +300,7 @@
 
 int main () {
   // Necessary to force instantiation in -fdelayed-template-parsing mode.
-  test_late_defined_uuid<int>(); 
+  test_late_defined_uuid<int>();
   redundant_typename<int>();
   missing_template_keyword<int>();
 }
Index: test/Sema/annotate.c
===================================================================
--- test/Sema/annotate.c	(revision 186980)
+++ test/Sema/annotate.c	(working copy)
@@ -2,7 +2,7 @@
 
 void __attribute__((annotate("foo"))) foo(float *a) {
   __attribute__((annotate("bar"))) int x;
-  __attribute__((annotate(1))) int y; // expected-error {{argument to annotate attribute was not a string literal}}
+  __attribute__((annotate(1))) int y; // expected-error {{'annotate' attribute requires a string}}
   __attribute__((annotate("bar", 1))) int z; // expected-error {{'annotate' attribute takes one argument}}
   int u = __builtin_annotation(z, (char*) 0); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
   int v = __builtin_annotation(z, (char*) L"bar"); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
Index: test/Sema/attr-section.c
===================================================================
--- test/Sema/attr-section.c	(revision 186979)
+++ test/Sema/attr-section.c	(working copy)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -verify -fsyntax-only -triple x86_64-apple-darwin9 %s
 
 int x __attribute__((section(
-   42)));  // expected-error {{argument to section attribute was not a string literal}}
+   42)));  // expected-error {{'section' attribute requires a string}}
 
 
 // rdar://4341926
Index: test/Sema/attr-tls_model.c
===================================================================
--- test/Sema/attr-tls_model.c	(revision 186980)
+++ test/Sema/attr-tls_model.c	(working copy)
@@ -10,5 +10,5 @@
 static __thread int y __attribute((tls_model("global-dynamic"))); // no-warning
 
 static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{'tls_model' attribute takes one argument}}
-static __thread int y __attribute((tls_model(123))); // expected-error {{argument to tls_model attribute was not a string literal}}
+static __thread int y __attribute((tls_model(123))); // expected-error {{'tls_model' attribute requires a string}}
 static __thread int y __attribute((tls_model("foobar"))); // expected-error {{tls_model must be "global-dynamic", "local-dynamic", "initial-exec" or "local-exec"}}
Index: test/Sema/attr-unavailable-message.c
===================================================================
--- test/Sema/attr-unavailable-message.c	(revision 186979)
+++ test/Sema/attr-unavailable-message.c	(working copy)
@@ -6,7 +6,7 @@
 
 void bar() __attribute__((__unavailable__)); // expected-note {{explicitly marked unavailable}}
 
-int quux(void) __attribute__((__unavailable__(12))); // expected-error {{argument to '__unavailable__' attribute was not a string literal}}
+int quux(void) __attribute__((__unavailable__(12))); // expected-error {{'__unavailable__' attribute requires a string}}
 
 #define ACCEPTABLE	"Use something else"
 int quux2(void) __attribute__((__unavailable__(ACCEPTABLE)));
@@ -37,13 +37,13 @@
     a = 1, // expected-note {{declared here}}
     b __attribute__((deprecated())) = 2, // expected-note {{declared here}}
     c = 3
-}__attribute__((deprecated()));  
+}__attribute__((deprecated()));
 
 enum fee { // expected-note {{declaration has been explicitly marked unavailable here}}
     r = 1, // expected-note {{declaration has been explicitly marked unavailable here}}
     s = 2,
     t = 3
-}__attribute__((unavailable()));  
+}__attribute__((unavailable()));
 
 enum fee f() { // expected-error {{'fee' is unavailable}}
     int i = a; // expected-warning {{'a' is deprecated}}
Index: test/Sema/callingconv.c
===================================================================
--- test/Sema/callingconv.c	(revision 186980)
+++ test/Sema/callingconv.c	(working copy)
@@ -39,7 +39,7 @@
 int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}}
 int __attribute__((pcs())) pcs2(void); // expected-error {{'pcs' attribute takes one argument}}
 int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute takes one argument}}
-int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires parameter 1 to be a string}}
+int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
 /* These are ignored because the target is i386 and not ARM */
 int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
 int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
Index: test/Sema/MicrosoftExtensions.c
===================================================================
--- test/Sema/MicrosoftExtensions.c	(revision 186979)
+++ test/Sema/MicrosoftExtensions.c	(working copy)
@@ -96,7 +96,7 @@
 #define MY_TEXT		"This is also deprecated"
 __declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {} // expected-note {{'Dfunc1' declared here}}
 
-struct __declspec(deprecated(123)) DS2 {};	// expected-error {{argument to 'deprecated' attribute was not a string literal}}
+struct __declspec(deprecated(123)) DS2 {};	// expected-error {{'deprecated' attribute requires a string}}
 
 void test( void ) {
 	e1 = one;	// expected-warning {{'e1' is deprecated: This is deprecated}}
Index: test/SemaObjC/attr-objc-gc.m
===================================================================
--- test/SemaObjC/attr-objc-gc.m	(revision 186980)
+++ test/SemaObjC/attr-objc-gc.m	(working copy)
@@ -2,8 +2,8 @@
 static id __attribute((objc_gc(weak))) a;
 static id __attribute((objc_gc(strong))) b;
 
-static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
-static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
+static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires a string}}
+static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires a string}}
 static id __attribute((objc_gc(foo, 456))) e; // expected-error{{'objc_gc' attribute takes one argument}}
 static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}}
 
