Refactor methods on DeclSpec to take a diagnostic& parameter, and reflect this
elsewhere.  Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77990 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index ad68f93..1a082db 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -522,8 +522,9 @@
       return DeclGroupPtrTy();
     }
     const char *PrevSpec = 0;
-    if (DS.SetTypeSpecType(DeclSpec::TST_unspecified, AtLoc, PrevSpec))
-      Diag(AtLoc, diag::err_invalid_decl_spec_combination) << PrevSpec;
+    unsigned DiagID;
+    if (DS.SetTypeSpecType(DeclSpec::TST_unspecified, AtLoc, PrevSpec, DiagID))
+      Diag(AtLoc, DiagID) << PrevSpec;
     
     DeclPtrTy TheDecl;
     if (Tok.isObjCAtKeyword(tok::objc_protocol))
@@ -619,9 +620,10 @@
   // declaration-specifiers are completely optional in the grammar.
   if (getLang().ImplicitInt && D.getDeclSpec().isEmpty()) {
     const char *PrevSpec;
+    unsigned DiagID;
     D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int,
                                            D.getIdentifierLoc(),
-                                           PrevSpec);
+                                           PrevSpec, DiagID);
     D.SetRangeBegin(D.getDeclSpec().getSourceRange().getBegin());
   }