Index: include/clang/Basic/Diagnostic.td
===================================================================
--- include/clang/Basic/Diagnostic.td	(revision 198043)
+++ include/clang/Basic/Diagnostic.td	(working copy)
@@ -88,6 +88,10 @@
 class ExtWarn<string str>   : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
 class Note<string str>      : Diagnostic<str, CLASS_NOTE, MAP_FATAL/*ignored*/>;
 
+multiclass warning_and_error<string str, DiagGroup G> {
+  def warn_ : Warning<str>, InGroup<G>;
+  def err_ : Error<str>;
+}
 
 class DefaultIgnore { DiagMapping DefaultMapping = MAP_IGNORE; }
 class DefaultWarn   { DiagMapping DefaultMapping = MAP_WARNING; }
Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 198055)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -1838,11 +1838,10 @@
   "%0 attribute parameter %1 is out of bounds">;
 def err_attribute_uuid_malformed_guid : Error<
   "uuid attribute contains a malformed GUID">;
-def warn_attribute_pointers_only : Warning<
-  "%0 attribute only applies to pointer arguments">,
-  InGroup<IgnoredAttributes>;
-def err_attribute_pointers_only : Error<
-  "%0 attribute only applies to pointer arguments">;
+
+defm attribute_pointers_only : warning_and_error<
+  "%0 attribute only applies to pointer arguments", IgnoredAttributes>;
+
 def err_attribute_no_member_pointers : Error<
   "%0 attribute cannot be used with pointers to members">;
 def err_attribute_invalid_implicit_this_argument : Error<
@@ -2024,7 +2023,8 @@
   "definition with same mangled name as another definition">;
 def err_cyclic_alias : Error<
   "alias definition is part of a cycle">;
-def warn_attribute_wrong_decl_type : Warning<
+
+defm attribute_wrong_decl_type : warning_and_error<
   "%0 attribute only applies to %select{functions|unions|"
   "variables and functions|functions and methods|parameters|"
   "functions, methods and blocks|functions, methods, and classes|"
@@ -2036,21 +2036,8 @@
   "struct or union|struct, union or class|types|"
   "Objective-C instance methods|init methods of interface declarations|"
   "variables, functions and classes|Objective-C protocols|"
-  "functions and global variables}1">,
-  InGroup<IgnoredAttributes>;
-def err_attribute_wrong_decl_type : Error<
-  "%0 attribute only applies to %select{functions|unions|"
-  "variables and functions|functions and methods|parameters|"
-  "functions, methods and blocks|functions, methods, and classes|"
-  "functions, methods, and parameters|classes|variables|methods|"
-  "variables, functions and labels|fields and global variables|structs|"
-  "variables, functions and tag types|thread-local variables|"
-  "variables and fields|variables, data members and tag types|"
-  "types and namespaces|Objective-C interfaces|methods and properties|"
-  "struct or union|struct, union or class|types|"
-  "Objective-C instance methods|init methods of interface declarations|"
-  "variables, functions and classes|Objective-C protocols|"
-  "functions and global variables}1">;
+  "functions and global variables}1", IgnoredAttributes>;
+
 def warn_type_attribute_wrong_type : Warning<
   "'%0' only applies to %select{function|pointer|"
   "Objective-C object or block pointer}1 types; type here is %2">,
