[clang-tools-extra] 2cb2cd2 - Change the behavior of implicit int diagnostics

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 05:36:02 PDT 2022


Author: Aaron Ballman
Date: 2022-05-04T08:35:47-04:00
New Revision: 2cb2cd242ca08d0bbd2a51a41f1317442e5414fc

URL: https://github.com/llvm/llvm-project/commit/2cb2cd242ca08d0bbd2a51a41f1317442e5414fc
DIFF: https://github.com/llvm/llvm-project/commit/2cb2cd242ca08d0bbd2a51a41f1317442e5414fc.diff

LOG: Change the behavior of implicit int diagnostics

C89 allowed a type specifier to be elided with the resulting type being
int, aka implicit int behavior. This feature was subsequently removed
in C99 without a deprecation period, so implementations continued to
support the feature. Now, as with implicit function declarations, is a
good time to reevaluate the need for this support.

This patch allows -Wimplicit-int to issue warnings in C89 mode (off by
default), defaults the warning to an error in C99 through C17, and
disables support for the feature entirely in C2x. It also removes a
warning about missing declaration specifiers that really was just an
implicit int warning in disguise and other minor related cleanups.

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
    clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp
    clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp
    clang/docs/ReleaseNotes.rst
    clang/include/clang/Basic/DiagnosticCommonKinds.td
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/include/clang/Basic/LangOptions.def
    clang/include/clang/Basic/LangOptions.h
    clang/include/clang/Basic/LangStandard.h
    clang/include/clang/Basic/LangStandards.def
    clang/lib/Basic/LangOptions.cpp
    clang/lib/Parse/ParseDecl.cpp
    clang/lib/Parse/Parser.cpp
    clang/lib/Sema/SemaDecl.cpp
    clang/lib/Sema/SemaType.cpp
    clang/test/Analysis/PR49642.c
    clang/test/Analysis/inline-unique-reports.c
    clang/test/Analysis/malloc.c
    clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
    clang/test/CXX/drs/dr2xx.cpp
    clang/test/CXX/drs/dr4xx.cpp
    clang/test/CXX/drs/dr5xx.cpp
    clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp
    clang/test/CXX/temp/p3.cpp
    clang/test/CXX/temp/temp.deduct.guide/p3.cpp
    clang/test/CXX/temp/temp.res/temp.local/p3.cpp
    clang/test/CodeGen/2002-07-14-MiscTests2.c
    clang/test/CodeGen/2003-08-20-vfork-bug.c
    clang/test/CodeGen/2007-04-24-bit-not-expr.c
    clang/test/CodeGen/2007-09-26-Alignment.c
    clang/test/CodeGen/2010-07-14-ref-off-end.c
    clang/test/CodeGen/mips-clobber-reg.c
    clang/test/CodeGen/mips-vector-arg.c
    clang/test/Driver/cxx_for_opencl.clcpp
    clang/test/FixIt/fixit.c
    clang/test/Frontend/fixed_point_errors.c
    clang/test/Frontend/fixed_point_not_enabled.c
    clang/test/Frontend/system-header-line-directive.c
    clang/test/Index/reparsed-live-issue.cpp
    clang/test/Misc/warning-flags.c
    clang/test/Modules/malformed-overload.m
    clang/test/Modules/va_list.m
    clang/test/PCH/decl-in-prototype.c
    clang/test/Parser/altivec.c
    clang/test/Parser/attributes.c
    clang/test/Parser/backtrack-off-by-one.cpp
    clang/test/Parser/c2x-attributes.c
    clang/test/Parser/c2x-func-prototype.c
    clang/test/Parser/colon-colon-parentheses.cpp
    clang/test/Parser/cxx-altivec.cpp
    clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
    clang/test/Parser/cxx-decl.cpp
    clang/test/Parser/cxx-keyword-identifiers.cpp
    clang/test/Parser/cxx-template-decl.cpp
    clang/test/Parser/cxx-undeclared-identifier.cpp
    clang/test/Parser/cxx2b-lambdas.cpp
    clang/test/Parser/declarators.c
    clang/test/Parser/explicit-bool.cpp
    clang/test/Parser/ext-int.cpp
    clang/test/Parser/objc-forcollection-neg-2.m
    clang/test/Parser/static_assert.c
    clang/test/Preprocessor/macro_paste_msextensions.c
    clang/test/Sema/address_spaces.c
    clang/test/Sema/auto-type.c
    clang/test/Sema/block-args.c
    clang/test/Sema/block-literal.c
    clang/test/Sema/c89.c
    clang/test/Sema/crash-invalid-builtin.c
    clang/test/Sema/darwin-tls.c
    clang/test/Sema/function.c
    clang/test/Sema/implicit-int.c
    clang/test/Sema/invalid-decl.c
    clang/test/Sema/invalid-struct-init.c
    clang/test/Sema/redefinition.c
    clang/test/Sema/return.c
    clang/test/Sema/typo-correction.c
    clang/test/Sema/warn-strict-prototypes.c
    clang/test/SemaCXX/MicrosoftSuper.cpp
    clang/test/SemaCXX/PR9459.cpp
    clang/test/SemaCXX/PR9460.cpp
    clang/test/SemaCXX/PR9461.cpp
    clang/test/SemaCXX/crashes.cpp
    clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
    clang/test/SemaCXX/for-range-crash.cpp
    clang/test/SemaCXX/implicit-int.cpp
    clang/test/SemaCXX/lambda-invalid-capture.cpp
    clang/test/SemaCXX/pr18284-crash-on-invalid.cpp
    clang/test/SemaCXX/typo-correction-delayed.cpp
    clang/test/SemaCXX/typo-correction.cpp
    clang/test/SemaCXX/unknown-type-name.cpp
    clang/test/SemaObjC/protocols.m
    clang/test/SemaObjCXX/crash.mm
    clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
    clang/test/SemaTemplate/address_space-dependent.cpp
    clang/test/SemaTemplate/derived.cpp
    clang/test/SemaTemplate/temp_arg_template.cpp
    clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
    clang/test/Tooling/auto-detect-from-source-parent.cpp
    clang/test/Tooling/clang-check-args.cpp
    clang/test/Tooling/clang-check-autodetect-dir.cpp
    clang/test/Tooling/clang-check-builtin-headers.cpp
    clang/test/Tooling/clang-check-chdir.cpp
    clang/test/Tooling/clang-check-pwd.cpp
    clang/test/Tooling/clang-check-rel-path.cpp
    clang/test/Tooling/clang-check-strip-o.cpp
    clang/test/Tooling/clang-check.cpp
    clang/test/Tooling/multi-jobs.cpp
    clang/unittests/AST/SourceLocationTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
index 6a5e341ceeccb..f6c347a919ed7 100644
--- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -1492,8 +1492,8 @@ TEST(DiagsInHeaders, DiagInsideHeader) {
   TU.AdditionalFiles = {{"a.h", std::string(Header.code())}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(AllOf(
-                  Diag(Main.range(), "in included file: C++ requires a "
-                                     "type specifier for all declarations"),
+                  Diag(Main.range(), "in included file: a type specifier is "
+                                     "required for all declarations"),
                   withNote(Diag(Header.range(), "error occurred here")))));
 }
 
@@ -1506,8 +1506,8 @@ TEST(DiagsInHeaders, DiagInTransitiveInclude) {
                         {"b.h", "no_type_spec; // error-ok"}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(
-                  Diag(Main.range(), "in included file: C++ requires a "
-                                     "type specifier for all declarations")));
+                  Diag(Main.range(), "in included file: a type specifier is "
+                                     "required for all declarations")));
 }
 
 TEST(DiagsInHeaders, DiagInMultipleHeaders) {
@@ -1520,10 +1520,10 @@ TEST(DiagsInHeaders, DiagInMultipleHeaders) {
                         {"b.h", "no_type_spec; // error-ok"}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(
-                  Diag(Main.range("a"), "in included file: C++ requires a type "
-                                        "specifier for all declarations"),
-                  Diag(Main.range("b"), "in included file: C++ requires a type "
-                                        "specifier for all declarations")));
+                  Diag(Main.range("a"), "in included file: a type specifier is "
+                                        "required for all declarations"),
+                  Diag(Main.range("b"), "in included file: a type specifier is "
+                                        "required for all declarations")));
 }
 
 TEST(DiagsInHeaders, PreferExpansionLocation) {
@@ -1537,8 +1537,8 @@ TEST(DiagsInHeaders, PreferExpansionLocation) {
       {"b.h", "#ifndef X\n#define X\nno_type_spec; // error-ok\n#endif"}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(Diag(Main.range(),
-                                        "in included file: C++ requires a type "
-                                        "specifier for all declarations")));
+                                        "in included file: a type specifier is "
+                                        "required for all declarations")));
 }
 
 TEST(DiagsInHeaders, PreferExpansionLocationMacros) {
@@ -1555,8 +1555,8 @@ TEST(DiagsInHeaders, PreferExpansionLocationMacros) {
       {"c.h", "#ifndef X\n#define X\nno_type_spec; // error-ok\n#endif"}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(
-                  Diag(Main.range(), "in included file: C++ requires a "
-                                     "type specifier for all declarations")));
+                  Diag(Main.range(), "in included file: a type specifier is "
+                                     "required for all declarations")));
 }
 
 TEST(DiagsInHeaders, LimitDiagsOutsideMainFile) {
@@ -1584,8 +1584,8 @@ TEST(DiagsInHeaders, LimitDiagsOutsideMainFile) {
       #endif)cpp"}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(
-                  Diag(Main.range(), "in included file: C++ requires a "
-                                     "type specifier for all declarations")));
+                  Diag(Main.range(), "in included file: a type specifier is "
+                                     "required for all declarations")));
 }
 
 TEST(DiagsInHeaders, OnlyErrorOrFatal) {
@@ -1599,8 +1599,8 @@ TEST(DiagsInHeaders, OnlyErrorOrFatal) {
   TU.AdditionalFiles = {{"a.h", std::string(Header.code())}};
   EXPECT_THAT(*TU.build().getDiagnostics(),
               UnorderedElementsAre(AllOf(
-                  Diag(Main.range(), "in included file: C++ requires "
-                                     "a type specifier for all declarations"),
+                  Diag(Main.range(), "in included file: a type specifier is "
+                                     "required for all declarations"),
                   withNote(Diag(Header.range(), "error occurred here")))));
 }
 

diff  --git a/clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp b/clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp
index d52ff94446213..5688c03ca0e16 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp
@@ -3,4 +3,4 @@
 struct Foo {
   member; // no-crash
 };
-// CHECK-MESSAGES: :[[@LINE-2]]:3: error: C++ requires a type specifier for all declarations [clang-diagnostic-error]
+// CHECK-MESSAGES: :[[@LINE-2]]:3: error: a type specifier is required for all declarations [clang-diagnostic-error]

diff  --git a/clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp
index 033798ceec46d..16ad4f175cab9 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp
@@ -20,7 +20,7 @@ struct Foo {
 // CHECK-MESSAGES: -input.cpp:3:7: error: 'a' declared as an array with a negative size [clang-diagnostic-error]
 // CHECK-MESSAGES: -input.cpp:4:7: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
 // CHECK-MESSAGES: -input.cpp:6:11: error: unknown type name 'x' [clang-diagnostic-error]
-// CHECK-MESSAGES: -input.cpp:8:3: error: C++ requires a type specifier for all declarations [clang-diagnostic-error]
+// CHECK-MESSAGES: -input.cpp:8:3: error: a type specifier is required for all declarations [clang-diagnostic-error]
 
 // CHECK-YAML: ---
 // CHECK-YAML-NEXT: MainSourceFile:  '{{.*}}-input.cpp'
@@ -88,7 +88,7 @@ struct Foo {
 // CHECK-YAML-NEXT:     BuildDirectory:  '{{.*}}'
 // CHECK-YAML-NEXT:   - DiagnosticName:  clang-diagnostic-error
 // CHECK-YAML-NEXT:     DiagnosticMessage:
-// CHECK-YAML-NEXT:       Message:         'C++ requires a type specifier for all declarations'
+// CHECK-YAML-NEXT:       Message:         a type specifier is required for all declarations
 // CHECK-YAML-NEXT:       FilePath:        '{{.*}}-input.cpp'
 // CHECK-YAML-NEXT:       FileOffset:      86
 // CHECK-YAML-NEXT:       Replacements:    []

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ca8d9a4ed0865..74d180053ee81 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -170,7 +170,17 @@ Improvements to Clang's diagnostics
   ``-Wno-implicit-function-declaration``. As of C2x, support for implicit
   function declarations has been removed, and the warning options will have no
   effect.
-
+- The ``-Wimplicit-int`` warning diagnostic now defaults to an error in C99 and
+  later. Prior to C2x, it may be downgraded to a warning with
+  ``-Wno-error=implicit-int``, or disabled entirely with ``-Wno-implicit-int``.
+  As of C2x, support for implicit int has been removed, and the warning options
+  will have no effect. Specifying ``-Wimplicit-int`` in C89 mode will now issue
+  warnings instead of being a noop.
+- No longer issue a "declaration specifiers missing, defaulting to int"
+  diagnostic in C89 mode because it is not an extension in C89, it was valid
+  code. The diagnostic has been removed entirely as it did not have a
+  diagnostic group to disable it, but it can be covered wholly by
+  ``-Wimplicit-int``.
 - ``-Wmisexpect`` warns when the branch weights collected during profiling
   conflict with those added by ``llvm.expect``.
 

diff  --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 66defc1d8ca5f..c140a33694f37 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -123,7 +123,9 @@ def err_enum_template : Error<"enumeration cannot be a template">;
 def warn_cxx20_compat_consteval : Warning<
   "'consteval' specifier is incompatible with C++ standards before C++20">,
   InGroup<CXX20Compat>, DefaultIgnore;
-
+def warn_missing_type_specifier : Warning<
+  "type specifier missing, defaults to 'int'">,
+  InGroup<ImplicitInt>, DefaultIgnore;
 }
 
 let CategoryName = "Nullability Issue" in {

diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 084d67af570e2..45540fae58538 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -4341,8 +4341,9 @@ def err_void_param_qualified : Error<
   "'void' as parameter must not have type qualifiers">;
 def err_ident_list_in_fn_declaration : Error<
   "a parameter list without types is only allowed in a function definition">;
-def ext_param_not_declared : Extension<
-  "parameter %0 was not declared, defaulting to type 'int'">;
+def ext_param_not_declared : ExtWarn<
+  "parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
+  "support implicit int">, InGroup<ImplicitInt>, DefaultError;
 def err_param_default_argument : Error<
   "C does not support default arguments">;
 def err_param_default_argument_redefinition : Error<
@@ -9997,15 +9998,13 @@ def warn_receiver_forward_class : Warning<
   "receiver %0 is a forward class and corresponding @interface may not exist">,
   InGroup<ForwardClassReceiver>;
 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
-def ext_missing_declspec : ExtWarn<
-  "declaration specifier missing, defaulting to 'int'">;
 def ext_missing_type_specifier : ExtWarn<
-  "type specifier missing, defaults to 'int'">,
-  InGroup<ImplicitInt>;
+  "type specifier missing, defaults to 'int'; ISO C99 and later do not support "
+  "implicit int">, InGroup<ImplicitInt>, DefaultError;
+def err_missing_type_specifier : Error<
+  "a type specifier is required for all declarations">;
 def err_decimal_unsupported : Error<
   "GNU decimal type extension not supported">;
-def err_missing_type_specifier : Error<
-  "C++ requires a type specifier for all declarations">;
 def err_objc_array_of_interfaces : Error<
   "array of interface %0 is invalid (probably should be an array of pointers)">;
 def ext_c99_array_usage : Extension<

diff  --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index 5c62c4c2673b0..bd66461f2f490 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -120,7 +120,6 @@ BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
 LANGOPT(GNUMode           , 1, 1, "GNU extensions")
 LANGOPT(GNUKeywords       , 1, 1, "GNU keywords")
 VALUE_LANGOPT(GNUCVersion , 32, 0, "GNU C compatibility version")
-BENIGN_LANGOPT(ImplicitInt, 1, 0, "C89 implicit 'int'")
 LANGOPT(DisableKNRFunctions, 1, 0, "require function types to have a prototype")
 LANGOPT(Digraphs          , 1, 0, "digraphs")
 BENIGN_LANGOPT(HexFloats  , 1, 0, "C99 hexadecimal float constants")

diff  --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h
index 83b8c062aa65c..caea03a9968e8 100644
--- a/clang/include/clang/Basic/LangOptions.h
+++ b/clang/include/clang/Basic/LangOptions.h
@@ -537,6 +537,12 @@ class LangOptions : public LangOptionsBase {
     return !requiresStrictPrototypes() && !OpenCL;
   }
 
+  /// Returns true if implicit int is part of the language requirements.
+  bool isImplicitIntRequired() const { return !CPlusPlus && !C99; }
+
+  /// Returns true if implicit int is supported at all.
+  bool isImplicitIntAllowed() const { return !CPlusPlus && !C2x; }
+
   /// Check if return address signing is enabled.
   bool hasSignReturnAddress() const {
     return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;

diff  --git a/clang/include/clang/Basic/LangStandard.h b/clang/include/clang/Basic/LangStandard.h
index 263985d6b1389..4e78570ff733b 100644
--- a/clang/include/clang/Basic/LangStandard.h
+++ b/clang/include/clang/Basic/LangStandard.h
@@ -59,9 +59,8 @@ enum LangFeatures {
   Digraphs = (1 << 11),
   GNUMode = (1 << 12),
   HexFloat = (1 << 13),
-  ImplicitInt = (1 << 14),
-  OpenCL = (1 << 15),
-  HLSL = (1 << 16)
+  OpenCL = (1 << 14),
+  HLSL = (1 << 15)
 };
 
 /// LangStandard - Information about the properties of a particular language
@@ -131,9 +130,6 @@ struct LangStandard {
   /// hasHexFloats - Language supports hexadecimal float constants.
   bool hasHexFloats() const { return Flags & HexFloat; }
 
-  /// hasImplicitInt - Language allows variables to be typed as int implicitly.
-  bool hasImplicitInt() const { return Flags & ImplicitInt; }
-
   /// isOpenCL - Language is a OpenCL variant.
   bool isOpenCL() const { return Flags & OpenCL; }
 

diff  --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
index d0e777b23b94f..323032f41da02 100644
--- a/clang/include/clang/Basic/LangStandards.def
+++ b/clang/include/clang/Basic/LangStandards.def
@@ -36,18 +36,17 @@
 
 // C89-ish modes.
 LANGSTANDARD(c89, "c89",
-             C, "ISO C 1990",
-             ImplicitInt)
+             C, "ISO C 1990", 0)
 LANGSTANDARD_ALIAS(c89, "c90")
 LANGSTANDARD_ALIAS(c89, "iso9899:1990")
 
 LANGSTANDARD(c94, "iso9899:199409",
              C, "ISO C 1990 with amendment 1",
-             Digraphs | ImplicitInt)
+             Digraphs)
 
 LANGSTANDARD(gnu89, "gnu89",
              C, "ISO C 1990 with GNU extensions",
-             LineComment | Digraphs | GNUMode | ImplicitInt)
+             LineComment | Digraphs | GNUMode)
 LANGSTANDARD_ALIAS(gnu89, "gnu90")
 
 // C99-ish modes

diff  --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp
index 8c19d7e86795e..2bc791cb32f69 100644
--- a/clang/lib/Basic/LangOptions.cpp
+++ b/clang/lib/Basic/LangOptions.cpp
@@ -113,7 +113,6 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang,
   Opts.GNUMode = Std.isGNUMode();
   Opts.GNUCVersion = 0;
   Opts.HexFloats = Std.hasHexFloats();
-  Opts.ImplicitInt = Std.hasImplicitInt();
   Opts.WChar = Std.isCPlusPlus();
   Opts.Digraphs = Std.hasDigraphs();
 

diff  --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 2b386c8de8d8f..3d18ffe07ee6b 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2637,8 +2637,8 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
   // error, do lookahead to try to do better recovery. This never applies
   // within a type specifier. Outside of C++, we allow this even if the
   // language doesn't "officially" support implicit int -- we support
-  // implicit int as an extension in C99 and C11.
-  if (!isTypeSpecifier(DSC) && !getLangOpts().CPlusPlus &&
+  // implicit int as an extension in some language modes.
+  if (!isTypeSpecifier(DSC) && getLangOpts().isImplicitIntAllowed() &&
       isValidAfterIdentifierInDeclarator(NextToken())) {
     // If this token is valid for implicit int, e.g. "static x = 4", then
     // we just avoid eating the identifier, so it will be parsed as the

diff  --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index e72dd93755b48..7ffaf057623f6 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -1195,10 +1195,12 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
   const DeclaratorChunk::FunctionTypeInfo &FTI = D.getFunctionTypeInfo();
   TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
 
-  // If this is C90 and the declspecs were completely missing, fudge in an
+  // If this is C89 and the declspecs were completely missing, fudge in an
   // implicit int.  We do this here because this is the only place where
   // declaration-specifiers are completely optional in the grammar.
-  if (getLangOpts().ImplicitInt && D.getDeclSpec().isEmpty()) {
+  if (getLangOpts().isImplicitIntRequired() && D.getDeclSpec().isEmpty()) {
+    Diag(D.getIdentifierLoc(), diag::warn_missing_type_specifier)
+        << D.getDeclSpec().getSourceRange();
     const char *PrevSpec;
     unsigned DiagID;
     const PrintingPolicy &Policy = Actions.getASTContext().getPrintingPolicy();

diff  --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f2b87c6d2e37e..0876e6efe243f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -14317,18 +14317,28 @@ void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
                                            SourceLocation LocAfterDecls) {
   DeclaratorChunk::FunctionTypeInfo &FTI = D.getFunctionTypeInfo();
 
-  // Verify 6.9.1p6: 'every identifier in the identifier list shall be declared'
-  // for a K&R function.
+  // C99 6.9.1p6 "If a declarator includes an identifier list, each declaration
+  // in the declaration list shall have at least one declarator, those
+  // declarators shall only declare identifiers from the identifier list, and
+  // every identifier in the identifier list shall be declared.
+  //
+  // C89 3.7.1p5 "If a declarator includes an identifier list, only the
+  // identifiers it names shall be declared in the declaration list."
+  //
+  // This is why we only diagnose in C99 and later. Note, the other conditions
+  // listed are checked elsewhere.
   if (!FTI.hasPrototype) {
     for (int i = FTI.NumParams; i != 0; /* decrement in loop */) {
       --i;
       if (FTI.Params[i].Param == nullptr) {
-        SmallString<256> Code;
-        llvm::raw_svector_ostream(Code)
-            << "  int " << FTI.Params[i].Ident->getName() << ";\n";
-        Diag(FTI.Params[i].IdentLoc, diag::ext_param_not_declared)
-            << FTI.Params[i].Ident
-            << FixItHint::CreateInsertion(LocAfterDecls, Code);
+        if (getLangOpts().C99) {
+          SmallString<256> Code;
+          llvm::raw_svector_ostream(Code)
+              << "  int " << FTI.Params[i].Ident->getName() << ";\n";
+          Diag(FTI.Params[i].IdentLoc, diag::ext_param_not_declared)
+              << FTI.Params[i].Ident
+              << FixItHint::CreateInsertion(LocAfterDecls, Code);
+        }
 
         // Implicitly declare the argument as type 'int' for lack of a better
         // type.

diff  --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index a037956d5e495..631a53263431c 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1343,35 +1343,34 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
     // allowed to be completely missing a declspec.  This is handled in the
     // parser already though by it pretending to have seen an 'int' in this
     // case.
-    if (S.getLangOpts().ImplicitInt) {
-      // In C89 mode, we only warn if there is a completely missing declspec
-      // when one is not allowed.
-      if (DS.isEmpty()) {
-        S.Diag(DeclLoc, diag::ext_missing_declspec)
-            << DS.getSourceRange()
-            << FixItHint::CreateInsertion(DS.getBeginLoc(), "int");
-      }
+    if (S.getLangOpts().isImplicitIntRequired()) {
+      S.Diag(DeclLoc, diag::warn_missing_type_specifier)
+          << DS.getSourceRange()
+          << FixItHint::CreateInsertion(DS.getBeginLoc(), "int");
     } else if (!DS.hasTypeSpecifier()) {
       // C99 and C++ require a type specifier.  For example, C99 6.7.2p2 says:
       // "At least one type specifier shall be given in the declaration
       // specifiers in each declaration, and in the specifier-qualifier list in
       // each struct declaration and type name."
-      if (S.getLangOpts().CPlusPlus && !DS.isTypeSpecPipe()) {
+      if (!S.getLangOpts().isImplicitIntAllowed() && !DS.isTypeSpecPipe()) {
         S.Diag(DeclLoc, diag::err_missing_type_specifier)
-          << DS.getSourceRange();
+            << DS.getSourceRange();
 
-        // When this occurs in C++ code, often something is very broken with the
-        // value being declared, poison it as invalid so we don't get chains of
+        // When this occurs, often something is very broken with the value
+        // being declared, poison it as invalid so we don't get chains of
         // errors.
         declarator.setInvalidType(true);
       } else if (S.getLangOpts().getOpenCLCompatibleVersion() >= 200 &&
                  DS.isTypeSpecPipe()) {
         S.Diag(DeclLoc, diag::err_missing_actual_pipe_type)
-          << DS.getSourceRange();
+            << DS.getSourceRange();
         declarator.setInvalidType(true);
       } else {
+        assert(S.getLangOpts().isImplicitIntAllowed() &&
+               "implicit int is disabled?");
         S.Diag(DeclLoc, diag::ext_missing_type_specifier)
-          << DS.getSourceRange();
+            << DS.getSourceRange()
+            << FixItHint::CreateInsertion(DS.getBeginLoc(), "int");
       }
     }
 

diff  --git a/clang/test/Analysis/PR49642.c b/clang/test/Analysis/PR49642.c
index b9bc27ad9f48c..6d8c65814b7af 100644
--- a/clang/test/Analysis/PR49642.c
+++ b/clang/test/Analysis/PR49642.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -Wno-implicit-function-declaration -w -verify %s \
+// RUN: %clang_analyze_cc1 -Wno-implicit-function-declaration -Wno-implicit-int -w -verify %s \
 // RUN:   -analyzer-checker=core \
 // RUN:   -analyzer-checker=apiModeling.StdCLibraryFunctions
 

diff  --git a/clang/test/Analysis/inline-unique-reports.c b/clang/test/Analysis/inline-unique-reports.c
index 9c1553b26d2b2..e58870ea74ab8 100644
--- a/clang/test/Analysis/inline-unique-reports.c
+++ b/clang/test/Analysis/inline-unique-reports.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -o %t > /dev/null 2>&1
+// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -Wno-error=implicit-int -o %t > /dev/null 2>&1
 // RUN: %normalize_plist <%t | 
diff  -ub %S/Inputs/expected-plists/inline-unique-reports.c.plist -
 
 static inline bug(int *p) {

diff  --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c
index daf5d71186282..7282a74bf0f4e 100644
--- a/clang/test/Analysis/malloc.c
+++ b/clang/test/Analysis/malloc.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -analyzer-store=region -verify %s \
+// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -Wno-error=implicit-int -analyzer-store=region -verify %s \
 // RUN:   -analyzer-checker=core \
 // RUN:   -analyzer-checker=alpha.deadcode.UnreachableCode \
 // RUN:   -analyzer-checker=alpha.core.CastSize \

diff  --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
index 83b12d4b25614..a71c6547de9ab 100644
--- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
@@ -7,7 +7,7 @@ struct S {
 
   // Note, this is not permitted: conversion-declarator cannot have a trailing return type.
   // FIXME: don't issue the second diagnostic for this.
-  operator auto(*)()->int(); // expected-error{{'auto' not allowed in conversion function type}} expected-error {{C++ requires a type specifier}}
+  operator auto(*)()->int(); // expected-error{{'auto' not allowed in conversion function type}} expected-error {{a type specifier is required}}
 };
 
 typedef auto Fun(int a) -> decltype(a + a);

diff  --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp
index 52aca02382094..4a409e56addee 100644
--- a/clang/test/CXX/drs/dr2xx.cpp
+++ b/clang/test/CXX/drs/dr2xx.cpp
@@ -1094,7 +1094,7 @@ namespace dr298 { // dr298: yes
   struct B b; // expected-error {{typedef 'B' cannot be referenced with a struct specifier}}
   struct C c; // expected-error {{typedef 'C' cannot be referenced with a struct specifier}}
 
-  B::B() {} // expected-error {{requires a type specifier}}
+  B::B() {} // expected-error {{a type specifier is required}}
   B::A() {} // ok
   C::~C() {} // expected-error {{destructor cannot be declared using a typedef 'dr298::C' (aka 'const dr298::A') of the class name}}
 

diff  --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp
index 7d06da552d1bd..bf4cd541b1ebb 100644
--- a/clang/test/CXX/drs/dr4xx.cpp
+++ b/clang/test/CXX/drs/dr4xx.cpp
@@ -1054,7 +1054,7 @@ namespace dr484 { // dr484: yes
   struct N::DT {}; // expected-error {{conflicts with typedef}}
 
   typedef struct {
-    S(); // expected-error {{requires a type}}
+    S(); // expected-error {{a type specifier is required}}
   } S;
 }
 

diff  --git a/clang/test/CXX/drs/dr5xx.cpp b/clang/test/CXX/drs/dr5xx.cpp
index 2099612e23f32..9e86995f821fd 100644
--- a/clang/test/CXX/drs/dr5xx.cpp
+++ b/clang/test/CXX/drs/dr5xx.cpp
@@ -162,7 +162,7 @@ namespace dr522 { // dr522: yes
   template<typename T> void b3(Base<T> *);
 
   void test(int n, const int cn, int **p, int *S::*pm) {
-    int *a[3], *S::*am[3]; 
+    int *a[3], *S::*am[3];
     const Derived cd = Derived();
     Derived d[3];
 
@@ -413,20 +413,20 @@ namespace dr535 { // dr535: yes
 // dr538: na
 
 // dr539: yes
-const dr539( // expected-error {{requires a type specifier}}
+const dr539( // expected-error {{a type specifier is required}}
     const a) { // expected-error {{unknown type name 'a'}}
-  const b; // expected-error {{requires a type specifier}}
+  const b; // expected-error {{a type specifier is required}}
   new const; // expected-error {{expected a type}}
   try {} catch (const n) {} // expected-error {{unknown type name 'n'}}
   try {} catch (const) {} // expected-error {{expected a type}}
-  if (const n = 0) {} // expected-error {{requires a type specifier}}
-  switch (const n = 0) {} // expected-error {{requires a type specifier}}
-  while (const n = 0) {} // expected-error {{requires a type specifier}}
-  for (const n = 0; // expected-error {{requires a type specifier}}
-       const m = 0; ) {} // expected-error {{requires a type specifier}}
-  sizeof(const); // expected-error {{requires a type specifier}}
+  if (const n = 0) {} // expected-error {{a type specifier is required}}
+  switch (const n = 0) {} // expected-error {{a type specifier is required}}
+  while (const n = 0) {} // expected-error {{a type specifier is required}}
+  for (const n = 0; // expected-error {{a type specifier is required}}
+       const m = 0; ) {} // expected-error {{a type specifier is required}}
+  sizeof(const); // expected-error {{a type specifier is required}}
   struct S {
-    const n; // expected-error {{requires a type specifier}}
+    const n; // expected-error {{a type specifier is required}}
     operator const(); // expected-error {{expected a type}}
   };
 #if __cplusplus >= 201103L
@@ -435,7 +435,7 @@ const dr539( // expected-error {{requires a type specifier}}
   // badly confused when recovering here. We should fix this recovery.
   { for (const n // expected-error {{unknown type name 'n'}} expected-note {{}}
          : arr) ; {} } // expected-error +{{}}
-  (void) [](const) {}; // expected-error {{requires a type specifier}}
+  (void) [](const) {}; // expected-error {{a type specifier is required}}
   (void) [](const n) {}; // expected-error {{unknown type name 'n'}}
   enum E : const {}; // expected-error {{expected a type}}
   using T = const; // expected-error {{expected a type}}
@@ -879,7 +879,7 @@ namespace dr585 { // dr585: yes
   struct A {
     friend T;
 #if __cplusplus <= 201402L
-    // expected-error at -2 {{requires a type specifier}} expected-error at -2 {{can only be classes or functions}}
+    // expected-error at -2 {{a type specifier is required}} expected-error at -2 {{can only be classes or functions}}
 #else
     // expected-error at -4 {{use of class template 'T' requires template arguments; argument deduction not allowed in friend declaration}}
     // expected-note at -7 {{here}}
@@ -891,7 +891,7 @@ namespace dr585 { // dr585: yes
   template<template<typename> class T> struct B {
     friend T;
 #if __cplusplus <= 201402L
-    // expected-error at -2 {{requires a type specifier}} expected-error at -2 {{can only be classes or functions}}
+    // expected-error at -2 {{a type specifier is required}} expected-error at -2 {{can only be classes or functions}}
 #else
     // expected-error at -4 {{use of template template parameter 'T' requires template arguments; argument deduction not allowed in friend declaration}}
     // expected-note at -6 {{here}}

diff  --git a/clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp b/clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp
index 7615536b81fc4..09e10978323c3 100644
--- a/clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp
+++ b/clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp
@@ -36,7 +36,7 @@ EXPORT module MODULE_NAME;
 // expected-error at -2 {{redefinition of module 'x'}}
 // expected-note-re at module-declaration.cpp:* {{loaded from '{{.*[/\\]}}x.pcm'}}
 #elif TEST == 7
-// expected-error at -5 {{expected ';'}} expected-error at -5 {{requires a type specifier}}
+// expected-error at -5 {{expected ';'}} expected-error at -5 {{a type specifier is required}}
 #elif TEST == 9
 // expected-warning at -7 {{unknown attribute 'fancy' ignored}}
 #elif TEST == 10

diff  --git a/clang/test/CXX/temp/p3.cpp b/clang/test/CXX/temp/p3.cpp
index 90f6397857aec..b708c613d352d 100644
--- a/clang/test/CXX/temp/p3.cpp
+++ b/clang/test/CXX/temp/p3.cpp
@@ -10,7 +10,7 @@ template<typename T> struct A { static A a; } A<T>::a; // expected-error {{expec
                                                           expected-error {{use of undeclared identifier 'T'}}
 
 template<typename T> struct B { } f(); // expected-error {{expected ';' after struct}} \
-                                          expected-error {{requires a type specifier}}
+                                          expected-error {{a type specifier is required}}
 
 template<typename T> struct C { } // expected-error {{expected ';' after struct}}
 

diff  --git a/clang/test/CXX/temp/temp.deduct.guide/p3.cpp b/clang/test/CXX/temp/temp.deduct.guide/p3.cpp
index 4ba6e8ef03732..33f70e5c019bb 100644
--- a/clang/test/CXX/temp/temp.deduct.guide/p3.cpp
+++ b/clang/test/CXX/temp/temp.deduct.guide/p3.cpp
@@ -24,9 +24,9 @@ template<typename T> using B = A<T>; // expected-note {{template}}
 B() -> B<int>; // expected-error {{cannot specify deduction guide for alias template 'B'}}
 // FIXME: expected-error at -1 {{declarator requires an identifier}}
 template<typename T> int C;
-C() -> int; // expected-error {{requires a type specifier}}
+C() -> int; // expected-error {{a type specifier is required}}
 template<typename T> void D();
-D() -> int; // expected-error {{requires a type specifier}}
+D() -> int; // expected-error {{a type specifier is required}}
 template<template<typename> typename TT> struct E { // expected-note 2{{template}}
   // FIXME: Should only diagnose this once!
   TT(int) -> TT<int>; // expected-error 2{{cannot specify deduction guide for template template parameter 'TT'}} expected-error {{requires an identifier}}

diff  --git a/clang/test/CXX/temp/temp.res/temp.local/p3.cpp b/clang/test/CXX/temp/temp.res/temp.local/p3.cpp
index ac03c7280828f..880931612bd23 100644
--- a/clang/test/CXX/temp/temp.res/temp.local/p3.cpp
+++ b/clang/test/CXX/temp/temp.res/temp.local/p3.cpp
@@ -4,7 +4,7 @@ template <class T> struct Base {
   // expected-note at -1 2{{member type 'Base<int>' found by ambiguous name lookup}}
   // expected-note at -2 2{{member type 'Base<char>' found by ambiguous name lookup}}
   static void f();
-}; 
+};
 
 struct X0 { };
 
@@ -26,7 +26,7 @@ namespace PR6717 {
   } // expected-error {{expected ';' after class}}
 
     WebVector(const WebVector<T>& other) { } // expected-error{{undeclared identifier 'T'}} \
-                                                expected-error{{requires a type specifier}}
+                                                expected-error{{a type specifier is required}}
 
   template <typename C>
   WebVector<T>& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}}

diff  --git a/clang/test/CodeGen/2002-07-14-MiscTests2.c b/clang/test/CodeGen/2002-07-14-MiscTests2.c
index ad1301766d3ab..4da1e92240ea2 100644
--- a/clang/test/CodeGen/2002-07-14-MiscTests2.c
+++ b/clang/test/CodeGen/2002-07-14-MiscTests2.c
@@ -2,7 +2,7 @@
 
 
 // Test ?: in function calls
-extern fp(int, char*);
+extern void fp(int, char*);
 char *Ext;
 void
 __bb_exit_func (void)

diff  --git a/clang/test/CodeGen/2003-08-20-vfork-bug.c b/clang/test/CodeGen/2003-08-20-vfork-bug.c
index 7ec0048828c13..4966ab20904d4 100644
--- a/clang/test/CodeGen/2003-08-20-vfork-bug.c
+++ b/clang/test/CodeGen/2003-08-20-vfork-bug.c
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
 
 extern int vfork(void);
-test() {
+void test() {
   vfork();
 }

diff  --git a/clang/test/CodeGen/2007-04-24-bit-not-expr.c b/clang/test/CodeGen/2007-04-24-bit-not-expr.c
index 9d99caffb5366..094378e931edc 100644
--- a/clang/test/CodeGen/2007-04-24-bit-not-expr.c
+++ b/clang/test/CodeGen/2007-04-24-bit-not-expr.c
@@ -1,6 +1,6 @@
 // PR 1346
 // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
-extern bar(void *);
+extern void bar(void *);
 
 void f(void *cd) {
   bar(((void *)((unsigned long)(cd) ^ -1)));

diff  --git a/clang/test/CodeGen/2007-09-26-Alignment.c b/clang/test/CodeGen/2007-09-26-Alignment.c
index 8ab130b0a708a..5d8670aaf50a6 100644
--- a/clang/test/CodeGen/2007-09-26-Alignment.c
+++ b/clang/test/CodeGen/2007-09-26-Alignment.c
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
-extern p(int *);
+extern void p(int *);
 int q(void) {
   // CHECK: alloca i32, align 16
   int x __attribute__ ((aligned (16)));

diff  --git a/clang/test/CodeGen/2010-07-14-ref-off-end.c b/clang/test/CodeGen/2010-07-14-ref-off-end.c
index 1c1bec8630636..f7bcfab6fdab8 100644
--- a/clang/test/CodeGen/2010-07-14-ref-off-end.c
+++ b/clang/test/CodeGen/2010-07-14-ref-off-end.c
@@ -6,13 +6,13 @@ struct T
 unsigned i:8;
 unsigned c:24;
 };
-f(struct T t)
+int f(struct T t)
 {
 struct T s[1];
 s[0]=t;
 return(char)s->c;
 }
-main(void)
+int main(void)
 {
 // CHECK:  getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0
 // CHECK:  getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0

diff  --git a/clang/test/CodeGen/mips-clobber-reg.c b/clang/test/CodeGen/mips-clobber-reg.c
index 18b6a72c13645..3bcf07b0bd2df 100644
--- a/clang/test/CodeGen/mips-clobber-reg.c
+++ b/clang/test/CodeGen/mips-clobber-reg.c
@@ -12,7 +12,7 @@
     Any bad names will make the frontend choke.
  */
 
-main(void)
+int main(void)
 {
 
     __asm__ __volatile__ (".set noat \n\t addi $7,$at,77":::"at");

diff  --git a/clang/test/CodeGen/mips-vector-arg.c b/clang/test/CodeGen/mips-vector-arg.c
index 511fca8e0e55f..d73e6ce0c9a83 100644
--- a/clang/test/CodeGen/mips-vector-arg.c
+++ b/clang/test/CodeGen/mips-vector-arg.c
@@ -9,19 +9,19 @@ typedef float  v4sf __attribute__ ((__vector_size__ (16)));
 typedef int v4i32 __attribute__ ((__vector_size__ (16)));
 
 // O32: define{{.*}} void @test_v4sf(i32 inreg noundef %a1.coerce0, i32 inreg noundef %a1.coerce1, i32 inreg noundef %a1.coerce2, i32 inreg noundef %a1.coerce3, i32 noundef signext %a2, i32 %0, i32 inreg noundef %a3.coerce0, i32 inreg noundef %a3.coerce1, i32 inreg noundef %a3.coerce2, i32 inreg noundef %a3.coerce3) local_unnamed_addr [[NUW:#[0-9]+]]
-// O32: declare i32 @test_v4sf_2(i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 noundef signext, i32, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef)
+// O32: declare void @test_v4sf_2(i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 noundef signext, i32, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef)
 // N64: define{{.*}} void @test_v4sf(i64 inreg noundef %a1.coerce0, i64 inreg noundef %a1.coerce1, i32 noundef signext %a2, i64 %0, i64 inreg noundef %a3.coerce0, i64 inreg noundef %a3.coerce1) local_unnamed_addr [[NUW:#[0-9]+]]
-// N64: declare signext i32 @test_v4sf_2(i64 inreg noundef, i64 inreg noundef, i32 noundef signext, i64, i64 inreg noundef, i64 inreg noundef)
-extern test_v4sf_2(v4sf, int, v4sf);
+// N64: declare void @test_v4sf_2(i64 inreg noundef, i64 inreg noundef, i32 noundef signext, i64, i64 inreg noundef, i64 inreg noundef)
+extern void test_v4sf_2(v4sf, int, v4sf);
 void test_v4sf(v4sf a1, int a2, v4sf a3) {
   test_v4sf_2(a3, a2, a1);
 }
 
 // O32: define{{.*}} void @test_v4i32(i32 inreg noundef %a1.coerce0, i32 inreg noundef %a1.coerce1, i32 inreg noundef %a1.coerce2, i32 inreg noundef %a1.coerce3, i32 noundef signext %a2, i32 %0, i32 inreg noundef %a3.coerce0, i32 inreg noundef %a3.coerce1, i32 inreg noundef %a3.coerce2, i32 inreg noundef %a3.coerce3) local_unnamed_addr [[NUW]]
-// O32: declare i32 @test_v4i32_2(i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 noundef signext, i32, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef)
+// O32: declare void @test_v4i32_2(i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 noundef signext, i32, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 inreg noundef)
 // N64: define{{.*}} void @test_v4i32(i64 inreg noundef %a1.coerce0, i64 inreg noundef %a1.coerce1, i32 noundef signext %a2, i64 %0, i64 inreg noundef %a3.coerce0, i64 inreg noundef %a3.coerce1) local_unnamed_addr [[NUW]]
-// N64: declare signext i32 @test_v4i32_2(i64 inreg noundef, i64 inreg noundef, i32 noundef signext, i64, i64 inreg noundef, i64 inreg noundef)
-extern test_v4i32_2(v4i32, int, v4i32);
+// N64: declare void @test_v4i32_2(i64 inreg noundef, i64 inreg noundef, i32 noundef signext, i64, i64 inreg noundef, i64 inreg noundef)
+extern void test_v4i32_2(v4i32, int, v4i32);
 void test_v4i32(v4i32 a1, int a2, v4i32 a3) {
   test_v4i32_2(a3, a2, a1);
 }

diff  --git a/clang/test/Driver/cxx_for_opencl.clcpp b/clang/test/Driver/cxx_for_opencl.clcpp
index e3e89c53b8886..fc2fc621791d9 100644
--- a/clang/test/Driver/cxx_for_opencl.clcpp
+++ b/clang/test/Driver/cxx_for_opencl.clcpp
@@ -13,6 +13,6 @@ kernel void k(){
   auto a = get_local_id(1);
 #ifndef __OPENCL_CPP_VERSION__
 //expected-error at -2{{OpenCL C version 2.0 does not support the 'auto' storage class specifier}}
-//expected-warning at -3{{type specifier missing, defaults to 'int'}}
+//expected-error at -3{{type specifier missing, defaults to 'int'}}
 #endif
 }

diff  --git a/clang/test/FixIt/fixit.c b/clang/test/FixIt/fixit.c
index 67bd94721d610..eda00c35ccbb2 100644
--- a/clang/test/FixIt/fixit.c
+++ b/clang/test/FixIt/fixit.c
@@ -29,7 +29,7 @@ int array0[5] = { [3] 3 }; // expected-warning {{GNU 'missing ='}}
 
 // CHECK: int x
 // CHECK: int y
-void f1(x, y) // expected-warning 2{{defaulting to type 'int'}}
+void f1(x, y) // expected-error 2{{was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
 {
 }
 
@@ -50,7 +50,7 @@ int test_cond(int y, int fooBar) { // expected-note {{here}}
 const typedef typedef int int_t; // expected-warning {{duplicate 'typedef'}}
 
 // <rdar://problem/7159693>
-enum Color { 
+enum Color {
   Red // expected-error{{missing ',' between enumerators}}
   Green = 17 // expected-error{{missing ',' between enumerators}}
   Blue,

diff  --git a/clang/test/Frontend/fixed_point_errors.c b/clang/test/Frontend/fixed_point_errors.c
index 2d12a1ebb10b9..6a711936f2397 100644
--- a/clang/test/Frontend/fixed_point_errors.c
+++ b/clang/test/Frontend/fixed_point_errors.c
@@ -228,9 +228,9 @@ void CheckSuffixOnIntegerLiterals(void) {
 
   // Using auto
   auto auto_fract = 0r;  // expected-error{{invalid suffix 'r' on integer constant}}
-                         // expected-warning at -1{{type specifier missing, defaults to 'int'}}
+                         // expected-error at -1{{type specifier missing, defaults to 'int'}}
   auto auto_accum = 0k;  // expected-error{{invalid suffix 'k' on integer constant}}
-                         // expected-warning at -1{{type specifier missing, defaults to 'int'}}
+                         // expected-error at -1{{type specifier missing, defaults to 'int'}}
 }
 
 // Ok conversions

diff  --git a/clang/test/Frontend/fixed_point_not_enabled.c b/clang/test/Frontend/fixed_point_not_enabled.c
index e7522213f98d6..a1a60c5a6fa80 100644
--- a/clang/test/Frontend/fixed_point_not_enabled.c
+++ b/clang/test/Frontend/fixed_point_not_enabled.c
@@ -11,7 +11,7 @@ unsigned long _Accum u_long_accum;    // expected-error{{compile with '-ffixed-p
 // Aliased fixed point types
 short _Accum short_accum;             // expected-error{{compile with '-ffixed-point' to enable fixed point types}}
 _Accum accum;                         // expected-error{{compile with '-ffixed-point' to enable fixed point types}}
-                                      // expected-warning at -1{{type specifier missing, defaults to 'int'}}
+                                      // expected-error at -1{{type specifier missing, defaults to 'int'}}
 long _Accum long_accum;               // expected-error{{compile with '-ffixed-point' to enable fixed point types}}
 
 // Cannot use fixed point suffixes

diff  --git a/clang/test/Frontend/system-header-line-directive.c b/clang/test/Frontend/system-header-line-directive.c
index 0de69196d76e2..d5705e028daa5 100644
--- a/clang/test/Frontend/system-header-line-directive.c
+++ b/clang/test/Frontend/system-header-line-directive.c
@@ -3,7 +3,7 @@
 #include <noline.h>
 #include <line-directive-in-system.h>
 
-// expected-warning at line-directive.h:* {{type specifier missing, defaults to 'int'}}
+// expected-error at line-directive.h:* {{type specifier missing, defaults to 'int'}}
 #include "line-directive.h"
 
 // This tests that "#line" directives in system headers preserve system

diff  --git a/clang/test/Index/reparsed-live-issue.cpp b/clang/test/Index/reparsed-live-issue.cpp
index 56423de0b72a7..9ff035920ee71 100644
--- a/clang/test/Index/reparsed-live-issue.cpp
+++ b/clang/test/Index/reparsed-live-issue.cpp
@@ -1,4 +1,4 @@
 // RUN: env CINDEXTEST_EDITING=1 LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-load-source-reparse 2 none -remap-file-0=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-0 -remap-file-1=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-1 -- %s 2>&1 | FileCheck %s
 #include "Inputs/reparse-issue.h"
 
-// CHECK: reparse-issue.h:4:1:{1:1-1:1}: error: C++ requires a type specifier for all declarations
+// CHECK: reparse-issue.h:4:1:{1:1-1:1}: error: a type specifier is required for all declarations

diff  --git a/clang/test/Misc/warning-flags.c b/clang/test/Misc/warning-flags.c
index a9e0a784c5c81..ac9a1f9f010c2 100644
--- a/clang/test/Misc/warning-flags.c
+++ b/clang/test/Misc/warning-flags.c
@@ -18,11 +18,10 @@ This test serves two purposes:
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (67):
+CHECK: Warnings without flags (66):
 
 CHECK-NEXT:   ext_expected_semi_decl_list
 CHECK-NEXT:   ext_explicit_specialization_storage_class
-CHECK-NEXT:   ext_missing_declspec
 CHECK-NEXT:   ext_missing_whitespace_after_macro_name
 CHECK-NEXT:   ext_new_paren_array_nonconst
 CHECK-NEXT:   ext_plain_complex
@@ -90,4 +89,4 @@ CHECK-NEXT:   warn_weak_import
 
 The list of warnings in -Wpedantic should NEVER grow.
 
-CHECK: Number in -Wpedantic (not covered by other -W flags): 27
+CHECK: Number in -Wpedantic (not covered by other -W flags): 26

diff  --git a/clang/test/Modules/malformed-overload.m b/clang/test/Modules/malformed-overload.m
index 369de580c9d74..fd5d2f4f696b4 100644
--- a/clang/test/Modules/malformed-overload.m
+++ b/clang/test/Modules/malformed-overload.m
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -fsyntax-only -I%S/Inputs/malformed-overload -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Wno-strict-prototypes -verify %s
-NSLog(@"%@", path); // expected-error {{expected parameter declarator}} expected-error {{expected ')'}} expected-warning {{type specifier missing}} expected-warning {{incompatible redeclaration}} expected-note {{to match this '('}} expected-note {{'NSLog' is a builtin with type}}
+NSLog(@"%@", path); // expected-error {{expected parameter declarator}} expected-error {{expected ')'}} expected-error {{type specifier missing}} expected-warning {{incompatible redeclaration}} expected-note {{to match this '('}} expected-note {{'NSLog' is a builtin with type}}
 #import "X.h"
 
 @class NSString;

diff  --git a/clang/test/Modules/va_list.m b/clang/test/Modules/va_list.m
index dd8f8955507d6..1de609a8a2e61 100644
--- a/clang/test/Modules/va_list.m
+++ b/clang/test/Modules/va_list.m
@@ -1,24 +1,24 @@
 // REQUIRES: x86-registered-target
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
-// RUN:     -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
+// RUN:     -fmodules-ignore-macro=PREFIX -DPREFIX -Wno-error=implicit-int -I %S/Inputs/va_list \
 // RUN:     -x objective-c-header %s -o %t.pch -emit-pch
 
 // Include the pch, as a basic correctness check.
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
-// RUN:     -fmodules-ignore-macro=PREFIX -I %S/Inputs/va_list -include-pch %t.pch \
+// RUN:     -fmodules-ignore-macro=PREFIX -I %S/Inputs/va_list -Wno-error=implicit-int -include-pch %t.pch \
 // RUN:     -x objective-c %s -fsyntax-only
 
 // Repeat the previous emit-pch, but not we will have a global module index.
 // For some reason, this results in an identifier for __va_list_tag being
 // emitted into the pch.
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
-// RUN:     -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
+// RUN:     -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list -Wno-error=implicit-int \
 // RUN:     -x objective-c-header %s -o %t.pch -emit-pch
 
 // Include the pch, which now has __va_list_tag in it, which needs to be merged.
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
-// RUN:     -fmodules-ignore-macro=PREFIX -I %S/Inputs/va_list -include-pch %t.pch \
+// RUN:     -fmodules-ignore-macro=PREFIX -Wno-error=implicit-int -I %S/Inputs/va_list -include-pch %t.pch \
 // RUN:     -x objective-c %s -fsyntax-only
 
 // rdar://18039719

diff  --git a/clang/test/PCH/decl-in-prototype.c b/clang/test/PCH/decl-in-prototype.c
index 865775a8fdbdd..12dd96073a9c4 100644
--- a/clang/test/PCH/decl-in-prototype.c
+++ b/clang/test/PCH/decl-in-prototype.c
@@ -14,7 +14,7 @@
 #ifndef HEADER
 #define HEADER
 
-static inline __attribute__((always_inline)) f(enum { x, y } p) {
+static inline __attribute__((always_inline)) int f(enum { x, y } p) {
   return y;
 }
 

diff  --git a/clang/test/Parser/altivec.c b/clang/test/Parser/altivec.c
index 3f344e9c5a13c..66d2ca33ed91e 100644
--- a/clang/test/Parser/altivec.c
+++ b/clang/test/Parser/altivec.c
@@ -97,8 +97,8 @@ vector unsigned long int v_uli;     // nonaix-warning {{Use of 'long' with '__ve
 // These should have warnings.
 __vector long double  vv_ld;        // expected-error {{cannot use 'long double' with '__vector'}}
 vector long double  v_ld;           // expected-error {{cannot use 'long double' with '__vector'}}
-vector bool v_b;                    // expected-warning {{type specifier missing, defaults to 'int'}}
-vector __bool v___b;                // expected-warning {{type specifier missing, defaults to 'int'}}
+vector bool v_b;                    // expected-error {{type specifier missing, defaults to 'int'}}
+vector __bool v___b;                // expected-error {{type specifier missing, defaults to 'int'}}
 
 // These should have errors.
 #ifndef __VSX__

diff  --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c
index bc7f826e67f6e..9f017c6958c2a 100644
--- a/clang/test/Parser/attributes.c
+++ b/clang/test/Parser/attributes.c
@@ -7,7 +7,7 @@ foo(void) {
 }
 
 
-__attribute__(()) y;   // expected-warning {{defaults to 'int'}}
+__attribute__(()) y;   // expected-error {{type specifier missing, defaults to 'int'}}
 
 // PR2796
 int (__attribute__(()) *z)(long y);
@@ -19,8 +19,8 @@ int f2(y, __attribute__(()) x);     // expected-error {{expected identifier}}
 
 // This is parsed as a normal argument list (with two args that are implicit
 // int) because the __attribute__ is a declspec.
-void f3(__attribute__(()) x,  // expected-warning {{defaults to 'int'}}
-        y);               // expected-warning {{defaults to 'int'}}
+void f3(__attribute__(()) x,  // expected-error {{type specifier missing, defaults to 'int'}}
+        y);               // expected-error {{type specifier missing, defaults to 'int'}}
 
 void f4(__attribute__(()));   // expected-error {{expected parameter declarator}}
 
@@ -30,14 +30,14 @@ int baz(int (__attribute__(()) *x)(long y));
 
 void g1(void (*f1)(__attribute__(()) int x));
 void g2(int (*f2)(y, __attribute__(()) x));    // expected-error {{expected identifier}}
-void g3(void (*f3)(__attribute__(()) x, int y));  // expected-warning {{defaults to 'int'}}
+void g3(void (*f3)(__attribute__(()) x, int y));  // expected-error {{type specifier missing, defaults to 'int'}}
 void g4(void (*f4)(__attribute__(())));  // expected-error {{expected parameter declarator}}
 
 
 void (*h1)(void (*f1)(__attribute__(()) int x));
 void (*h2)(int (*f2)(y, __attribute__(()) x));    // expected-error {{expected identifier}}
 
-void (*h3)(void (*f3)(__attribute__(()) x));   // expected-warning {{defaults to 'int'}}
+void (*h3)(void (*f3)(__attribute__(()) x));   // expected-error {{type specifier missing, defaults to 'int'}}
 void (*h4)(void (*f4)(__attribute__(())));  // expected-error {{expected parameter declarator}}
 
 

diff  --git a/clang/test/Parser/backtrack-off-by-one.cpp b/clang/test/Parser/backtrack-off-by-one.cpp
index 52e1c41478393..b5c05aeee9d93 100644
--- a/clang/test/Parser/backtrack-off-by-one.cpp
+++ b/clang/test/Parser/backtrack-off-by-one.cpp
@@ -17,7 +17,7 @@ template <typename T> class B : T // not ',' or '{'
 // expected-error at +8 {{expected ';' after top level declarator}}
 #endif
 #if __cplusplus <= 201402L
-// expected-error at +5 {{C++ requires a type specifier for all declarations}}
+// expected-error at +5 {{a type specifier is required for all declarations}}
 #else
 // expected-error at +3 {{expected unqualified-id}}
 #endif

diff  --git a/clang/test/Parser/c2x-attributes.c b/clang/test/Parser/c2x-attributes.c
index cffc6cd174dce..e1265f73a4767 100644
--- a/clang/test/Parser/c2x-attributes.c
+++ b/clang/test/Parser/c2x-attributes.c
@@ -60,7 +60,8 @@ void f4(void) [[]];
 void f5(int i [[]], [[]] int j, int [[]] k);
 
 void f6(a, b) [[]] int a; int b; { // notc2x-error {{an attribute list cannot appear here}} \
-                                      c2x-warning 2 {{type specifier missing, defaults to 'int'}} \
+                                      c2x-error {{unknown type name 'a'}} \
+                                      c2x-error {{unknown type name 'b'}} \
                                       c2x-error {{expected ';' after top level declarator}} \
                                       c2x-error {{expected identifier or '('}}
 }
@@ -70,7 +71,8 @@ void f6(a, b) [[]] int a; int b; { // notc2x-error {{an attribute list cannot ap
 // behavior given that we *don't* want to parse it as part of the K&R parameter
 // declarations. It is disallowed to avoid a parsing ambiguity we already
 // handle well.
-int (*f7(a, b))(int, int) [[]] int a; int b; { // c2x-warning 2 {{type specifier missing, defaults to 'int'}} \
+int (*f7(a, b))(int, int) [[]] int a; int b; { // c2x-error {{unknown type name 'a'}} \
+                                                  c2x-error {{unknown type name 'b'}} \
                                                   c2x-error {{expected ';' after top level declarator}} \
                                                   c2x-error {{expected identifier or '('}}
 

diff  --git a/clang/test/Parser/c2x-func-prototype.c b/clang/test/Parser/c2x-func-prototype.c
index ff5194547277c..2602fa8195eaa 100644
--- a/clang/test/Parser/c2x-func-prototype.c
+++ b/clang/test/Parser/c2x-func-prototype.c
@@ -4,7 +4,7 @@
 
 // Functions with an identifier list are not supported in C2x.
 void ident_list(a) // c2x-error {{expected ';' after top level declarator}} \
-                      c2x-warning {{type specifier missing, defaults to 'int'}}
+                      c2x-error {{unknown type name 'a'}}
   int a;
 {}                 // c2x-error {{expected identifier or '('}}
 

diff  --git a/clang/test/Parser/colon-colon-parentheses.cpp b/clang/test/Parser/colon-colon-parentheses.cpp
index 804e4f785ee63..b8e203c935990 100644
--- a/clang/test/Parser/colon-colon-parentheses.cpp
+++ b/clang/test/Parser/colon-colon-parentheses.cpp
@@ -24,7 +24,7 @@ void foo() {
 // The following tests used to be crash bugs.
 
 // PR21815
-// expected-error at +2{{C++ requires a type specifier for all declarations}}
+// expected-error at +2{{a type specifier is required for all declarations}}
 // expected-error at +1{{expected unqualified-id}}
 a (::( ));
 

diff  --git a/clang/test/Parser/cxx-altivec.cpp b/clang/test/Parser/cxx-altivec.cpp
index 5b04e23e7ab0a..11ac15ef46097 100644
--- a/clang/test/Parser/cxx-altivec.cpp
+++ b/clang/test/Parser/cxx-altivec.cpp
@@ -112,7 +112,8 @@ vector __bool long long v_bll4;      // expected-error {{use of 'long long' with
 #endif
 __vector long double  vv_ld3;        // expected-error {{cannot use 'long double' with '__vector'}}
 vector long double  v_ld4;           // expected-error {{cannot use 'long double' with '__vector'}}
-vector bool v_b;                     // expected-error {{C++ requires a type specifier for all declarations}}
+// FIXME: why is this diagnostic 
diff erent from the others?
+vector bool v_b;                     // expected-error {{a type specifier is required for all declarations}}
 vector bool float v_bf;              // expected-error {{cannot use 'float' with '__vector bool'}}
 vector bool double v_bd;             // expected-error {{cannot use 'double' with '__vector bool'}}
 vector bool pixel v_bp;              // expected-error {{cannot use '__pixel' with '__vector bool'}}

diff  --git a/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp b/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
index f85cfcee5a202..4dcd9937f2650 100644
--- a/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
+++ b/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
@@ -6,4 +6,4 @@
 
 // type-specifier-seq in conversion-type-id
 template <typename T> requires T::operator short
-unsigned int foo(); // expected-error {{C++ requires a type specifier for all declarations}}
\ No newline at end of file
+unsigned int foo(); // expected-error {{a type specifier is required for all declarations}}
\ No newline at end of file

diff  --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp
index dbf3a3e70bb03..725141d138fd6 100644
--- a/clang/test/Parser/cxx-decl.cpp
+++ b/clang/test/Parser/cxx-decl.cpp
@@ -30,7 +30,7 @@ y::a a3 = a2;
 void foo() {
 y:  // label
   y::a s;
-  
+
   int a = 4;
   a = a ? a : a+1;
 }
@@ -39,7 +39,7 @@ struct b : y::a {};
 
 template <typename T>
 class someclass {
-  
+
   int bar() {
     T *P;
     return 1 ? P->x : P->y;
@@ -62,7 +62,7 @@ struct a {
 void test(struct Type *P) {
   int Type;
   Type = 1 ? P->Type : Type;
-  
+
   Type = (y:b) 4;   // expected-error {{unexpected ':' in nested name specifier}}
   Type = 1 ? (
               (y:b)  // expected-error {{unexpected ':' in nested name specifier}}
@@ -128,7 +128,7 @@ struct CodeCompleteConsumer {
 };
 
 void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}}
-} 
+}
 
 ;
 
@@ -306,14 +306,14 @@ namespace rdar37099386 {
 
 // PR8380
 extern ""      // expected-error {{unknown linkage language}}
-test6a { ;// expected-error {{C++ requires a type specifier for all declarations}}
+test6a { ;// expected-error {{a type specifier is required for all declarations}}
 #if __cplusplus <= 199711L
 // expected-error at -2 {{expected ';' after top level declarator}}
 #else
 // expected-error at -4 {{expected expression}}
 // expected-note at -5 {{to match this}}
 #endif
-  
+
   int test6b;
 #if __cplusplus >= 201103L
 // expected-error at +3 {{expected}}

diff  --git a/clang/test/Parser/cxx-keyword-identifiers.cpp b/clang/test/Parser/cxx-keyword-identifiers.cpp
index 2c6f18ec83e04..471a21a556853 100644
--- a/clang/test/Parser/cxx-keyword-identifiers.cpp
+++ b/clang/test/Parser/cxx-keyword-identifiers.cpp
@@ -26,6 +26,6 @@ void test() {
   };
 }
 struct Foo {
-  void bar(*decltype(1) aux); // expected-error {{C++ requires a type specifier for all declarations}}. \
+  void bar(*decltype(1) aux); // expected-error {{a type specifier is required for all declarations}}. \
                                  // expected-error {{expected ')'}} expected-note {{to match this '('}}
 };

diff  --git a/clang/test/Parser/cxx-template-decl.cpp b/clang/test/Parser/cxx-template-decl.cpp
index 26f6ce224ef32..55c71b46da75d 100644
--- a/clang/test/Parser/cxx-template-decl.cpp
+++ b/clang/test/Parser/cxx-template-decl.cpp
@@ -6,7 +6,7 @@
 
 // Errors
 export class foo { };   // expected-error {{expected template}}
-template  x;            // expected-error {{C++ requires a type specifier for all declarations}} \
+template  x;            // expected-error {{a type specifier is required for all declarations}} \
                         // expected-error {{does not refer}}
 export template x;      // expected-error {{expected '<' after 'template'}}
 export template<class T> class x0; // expected-warning {{exported templates are unsupported}}
@@ -62,7 +62,7 @@ template <int> class NTP0;
 template <int N> class NTP1;
 template <int N = 5> class NTP2;
 template <int = 10> class NTP3;
-template <unsigned int N = 12u> class NTP4; 
+template <unsigned int N = 12u> class NTP4;
 template <unsigned int = 12u> class NTP5;
 template <unsigned = 15u> class NTP6;
 template <typename T, T Obj> class NTP7;
@@ -111,11 +111,11 @@ template<template<typename> class T> struct shadow8 { // expected-note{{template
 };
 
 // Non-type template parameters in scope
-template<int Size> 
+template<int Size>
 void f(int& i) {
   i = Size;
  #ifdef DELAYED_TEMPLATE_PARSING
-  Size = i; 
+  Size = i;
  #else
   Size = i; // expected-error{{expression is not assignable}}
  #endif
@@ -144,7 +144,7 @@ namespace PR6184 {
     template <typename T>
     void bar(typename T::x);
   }
-  
+
   template <typename T>
   void N::bar(typename T::x) { }
 }
@@ -198,7 +198,7 @@ struct L {
   struct O {
     template <typename U>
     static oneT Fun(U);
-    
+
   };
 };
 template <int k>
@@ -212,8 +212,8 @@ template<typename U>
 oneT L<0>::O<char>::Fun(U) { return one; }
 
 
-void Instantiate() { 
-  sassert(sizeof(L<0>::O<int>::Fun(0)) == sizeof(one)); 
+void Instantiate() {
+  sassert(sizeof(L<0>::O<int>::Fun(0)) == sizeof(one));
   sassert(sizeof(L<0>::O<char>::Fun(0)) == sizeof(one));
 }
 

diff  --git a/clang/test/Parser/cxx-undeclared-identifier.cpp b/clang/test/Parser/cxx-undeclared-identifier.cpp
index a3f9e0279496d..c5bf8ae9944ee 100644
--- a/clang/test/Parser/cxx-undeclared-identifier.cpp
+++ b/clang/test/Parser/cxx-undeclared-identifier.cpp
@@ -1,15 +1,15 @@
 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
 
 namespace ImplicitInt {
-  static a(4); // expected-error {{requires a type specifier}}
-  b(int n); // expected-error {{requires a type specifier}}
+  static a(4); // expected-error {{a type specifier is required}}
+  b(int n); // expected-error {{a type specifier is required}}
   c (*p)[]; // expected-error {{unknown type name 'c'}}
-  itn f(char *p, *q); // expected-error {{unknown type name 'itn'}} expected-error {{requires a type specifier}}
+  itn f(char *p, *q); // expected-error {{unknown type name 'itn'}} expected-error {{a type specifier is required}}
 
   struct S {
     void f();
   };
-  S::f() {} // expected-error {{requires a type specifier}}
+  S::f() {} // expected-error {{a type specifier is required}}
 }
 
 // PR7180

diff  --git a/clang/test/Parser/cxx2b-lambdas.cpp b/clang/test/Parser/cxx2b-lambdas.cpp
index 57e81eed7b9e0..19e9bf009ba12 100644
--- a/clang/test/Parser/cxx2b-lambdas.cpp
+++ b/clang/test/Parser/cxx2b-lambdas.cpp
@@ -28,7 +28,7 @@ auto XL1 = [] constexpr mutable constexpr {};  // expected-error{{cannot appear
 auto XL2 = []) constexpr mutable constexpr {}; // expected-error{{expected body of lambda expression}}
 auto XL3 = []( constexpr mutable constexpr {}; // expected-error{{invalid storage class specifier}} \
                                                // expected-error{{function parameter cannot be constexpr}} \
-                                               // expected-error{{C++ requires}} \
+                                               // expected-error{{a type specifier is required}} \
                                                // expected-error{{expected ')'}} \
                                                // expected-note{{to match this '('}} \
                                                // expected-error{{expected body}} \

diff  --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c
index 0faedca8d29b9..c309cada073a9 100644
--- a/clang/test/Parser/declarators.c
+++ b/clang/test/Parser/declarators.c
@@ -6,7 +6,7 @@ void f0(); /* expected-warning {{a function declaration without a prototype is d
 void f1(int [*]);
 void f2(int [const *]);
 void f3(int [volatile const*]);
-int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier missing, defaults to 'int'}} */
+int f4(*XX)(void); /* expected-error {{cannot return}} expected-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} */
 int f5(int [static]); /* expected-error {{'static' may not be used without an array size}} */
 
 char ((((*X))));
@@ -64,9 +64,9 @@ struct xyz test8(void) { return a; }  // a should be be marked invalid, no diag.
 
 
 // Verify that implicit int still works.
-static f;      // expected-warning {{type specifier missing, defaults to 'int'}}
-static g = 4;  // expected-warning {{type specifier missing, defaults to 'int'}}
-static h        // expected-warning {{type specifier missing, defaults to 'int'}} 
+static f;      // expected-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
+static g = 4;  // expected-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
+static h        // expected-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
       __asm__("foo");
 
 

diff  --git a/clang/test/Parser/explicit-bool.cpp b/clang/test/Parser/explicit-bool.cpp
index aa700bcfd28a6..b1dd2217b7748 100644
--- a/clang/test/Parser/explicit-bool.cpp
+++ b/clang/test/Parser/explicit-bool.cpp
@@ -54,7 +54,7 @@ struct B {
   // cxx20-warning@#4 {{incompatible with C++ standards before C++20}}
 
   explicit (operator+(A())) operator int(); // #5
-  // cxx17-error@#5 {{requires a type specifier}} cxx17-error@#5 {{expected ';'}}
+  // cxx17-error@#5 {{a type specifier is required}} cxx17-error@#5 {{expected ';'}}
   // cxx17-warning@#5 {{will be parsed as explicit(bool)}}
   // cxx20-warning@#5 {{incompatible with C++ standards before C++20}}
 };

diff  --git a/clang/test/Parser/ext-int.cpp b/clang/test/Parser/ext-int.cpp
index e709493a9ea42..e0132941a7a0d 100644
--- a/clang/test/Parser/ext-int.cpp
+++ b/clang/test/Parser/ext-int.cpp
@@ -4,12 +4,12 @@
 // expected-note at +4{{to match this '('}}
 // expected-error at +3{{expected unqualified-id}}
 // expected-error at +2{{extraneous closing brace}}
-// expected-error at +1{{C++ requires a type specifier for all declarations}}
+// expected-error at +1{{a type specifier is required for all declarations}}
 _BitInt(32} a;
 // expected-error at +2{{expected expression}}
-// expected-error at +1{{C++ requires a type specifier for all declarations}}
+// expected-error at +1{{a type specifier is required for all declarations}}
 _BitInt(32* ) b;
 // expected-error at +3{{expected '('}}
 // expected-error at +2{{expected unqualified-id}}
-// expected-error at +1{{C++ requires a type specifier for all declarations}}
+// expected-error at +1{{a type specifier is required for all declarations}}
 _BitInt{32} c;

diff  --git a/clang/test/Parser/objc-forcollection-neg-2.m b/clang/test/Parser/objc-forcollection-neg-2.m
index f95dd1356bc3e..e28b74f3f4424 100644
--- a/clang/test/Parser/objc-forcollection-neg-2.m
+++ b/clang/test/Parser/objc-forcollection-neg-2.m
@@ -24,7 +24,7 @@ - (void)compilerTestAgainst;
 
 @implementation MyList (BasicTest)
 - (void)compilerTestAgainst {
-    static i;// expected-warning {{type specifier missing, defaults to 'int'}}
+    static i;// expected-error {{type specifier missing, defaults to 'int'}}
         for (id el, elem in self)  // expected-error {{only one element declaration is allowed}}
            ++i;
         for (id el in self) 

diff  --git a/clang/test/Parser/static_assert.c b/clang/test/Parser/static_assert.c
index 452c404a79ce9..c57e3b0e06804 100644
--- a/clang/test/Parser/static_assert.c
+++ b/clang/test/Parser/static_assert.c
@@ -18,7 +18,7 @@
 static_assert(1, ""); // c2x-error {{expected parameter declarator}} \
                       // c2x-error {{expected ')'}} \
                       // c2x-note {{to match this '('}} \
-                      // c2x-warning {{type specifier missing, defaults to 'int'}} \
+                      // c2x-error {{a type specifier is required for all declarations}} \
                       // c2x-ms-warning {{use of 'static_assert' without inclusion of <assert.h> is a Microsoft extension}}
 #endif
 

diff  --git a/clang/test/Preprocessor/macro_paste_msextensions.c b/clang/test/Preprocessor/macro_paste_msextensions.c
index dcc5336b91c14..1549ff5e55620 100644
--- a/clang/test/Preprocessor/macro_paste_msextensions.c
+++ b/clang/test/Preprocessor/macro_paste_msextensions.c
@@ -32,7 +32,7 @@ nested(baz)  rise of the dead tokens
 // rdar://8197149 - VC++ allows invalid token pastes: (##baz
 #define foo(x) abc(x)
 #define bar(y) foo(##baz(y))
-bar(q) // expected-warning {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}}
+bar(q) // expected-error {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}}
 
 // CHECK: abc(baz(q))
 

diff  --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c
index 085bef9b72d31..ff7a134e04ebf 100644
--- a/clang/test/Sema/address_spaces.c
+++ b/clang/test/Sema/address_spaces.c
@@ -9,7 +9,7 @@ void bar(_AS2 int a); // expected-error {{parameter may not be qualified with an
 void foo(_AS3 float *a,
          _AS1 float b) // expected-error {{parameter may not be qualified with an address space}}
 {
-  _AS2 *x;// expected-warning {{type specifier missing, defaults to 'int'}}
+  _AS2 *x;// expected-error {{type specifier missing, defaults to 'int'}}
   _AS1 float * _AS2 *B;
 
   int _AS1 _AS2 *Y;   // expected-error {{multiple address spaces specified for type}}

diff  --git a/clang/test/Sema/auto-type.c b/clang/test/Sema/auto-type.c
index 7faa8a6984e7a..4e85eecc6b057 100644
--- a/clang/test/Sema/auto-type.c
+++ b/clang/test/Sema/auto-type.c
@@ -37,7 +37,7 @@ void Issue53652(void) {
 
   // GCC does not accept this either, for the same reason.
   _Atomic(__auto_type) aat2 = a; // expected-error {{'__auto_type' not allowed here}} \
-                                 // expected-warning {{type specifier missing, defaults to 'int'}}
+                                 // expected-error {{type specifier missing, defaults to 'int'}}
 
   // Ensure the types are what we expect them to be, regardless of order we
   // pass the types.

diff  --git a/clang/test/Sema/block-args.c b/clang/test/Sema/block-args.c
index 245b2c02b8067..1e000abf4b361 100644
--- a/clang/test/Sema/block-args.c
+++ b/clang/test/Sema/block-args.c
@@ -37,7 +37,7 @@ void f0(void) {
 
 // rdar://problem/8962770
 void test4(void) {
-  int (^f)(void) = ^((x)) { }; // expected-warning {{type specifier missing}} expected-error {{type-id cannot have a name}}
+  int (^f)(void) = ^((x)) { }; // expected-error {{type specifier missing}} expected-error {{type-id cannot have a name}}
 }
 
 // rdar://problem/9170609

diff  --git a/clang/test/Sema/block-literal.c b/clang/test/Sema/block-literal.c
index d1607cec098c5..b760c647f0d19 100644
--- a/clang/test/Sema/block-literal.c
+++ b/clang/test/Sema/block-literal.c
@@ -29,7 +29,7 @@ void test2(void) {
   takeblock(^{ printf("%d\n", x); });
 
   while (1) {
-    takeblock(^{ 
+    takeblock(^{
         break;  // expected-error {{'break' statement not in loop or switch statement}}
         continue; // expected-error {{'continue' statement not in loop statement}}
         while(1) break;  // ok
@@ -41,12 +41,12 @@ void test2(void) {
 
   foo:
   takeblock(^{ x = 4; });  // expected-error {{variable is not assignable (missing __block type specifier)}}
-  __block y = 7;    // expected-warning {{type specifier missing, defaults to 'int'}}
+  __block y = 7;    // expected-error {{type specifier missing, defaults to 'int'}}
   takeblock(^{ y = 8; });
 }
 
 
-void (^test3(void))(void) { 
+void (^test3(void))(void) {
   return ^{};
 }
 
@@ -86,4 +86,4 @@ typedef void (^void_block_t)(void);
 
 static const void_block_t myBlock = ^{ };
 
-static const void_block_t myBlock2 = ^ void(void) { }; 
+static const void_block_t myBlock2 = ^ void(void) { };

diff  --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
index 210574c550918..0bbd14eca6b41 100644
--- a/clang/test/Sema/c89.c
+++ b/clang/test/Sema/c89.c
@@ -39,20 +39,16 @@ int *__restrict;  /* expected-error {{expected identifier}} */
 test6(void) { return 0; }
 
 /* PR2012 */
-test7;  /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
+test7;
 
-void test8(int, x);  /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
+void test8(int, x);
 
 typedef int sometype;
-int a(sometype, y) {return 0;}  /* expected-warning {{declaration specifier missing, defaulting to 'int'}} \
-                                   expected-warning {{omitting the parameter name in a function definition is a C2x extension}}*/
+int a(sometype, y) {return 0;}  /* expected-warning {{omitting the parameter name in a function definition is a C2x extension}}*/
 
-
-
-
-void bar (void *); 
+void bar (void *);
 void f11 (z)       /* expected-error {{may not have 'void' type}} */
-void z; 
+void z;
 { bar (&z); }
 
 typedef void T;

diff  --git a/clang/test/Sema/crash-invalid-builtin.c b/clang/test/Sema/crash-invalid-builtin.c
index 8f749f7b32bb5..26e5888a9e30e 100644
--- a/clang/test/Sema/crash-invalid-builtin.c
+++ b/clang/test/Sema/crash-invalid-builtin.c
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
 // PR23086
 
-__builtin_isinf(...); // expected-warning {{type specifier missing, defaults to 'int'}} expected-error {{ISO C requires a named parameter before '...'}} // expected-error {{cannot redeclare builtin function '__builtin_isinf'}} // expected-note {{'__builtin_isinf' is a builtin with type 'int ()'}}
+__builtin_isinf(...); // expected-error {{type specifier missing, defaults to 'int'}} expected-error {{ISO C requires a named parameter before '...'}} // expected-error {{cannot redeclare builtin function '__builtin_isinf'}} // expected-note {{'__builtin_isinf' is a builtin with type 'int ()'}}

diff  --git a/clang/test/Sema/darwin-tls.c b/clang/test/Sema/darwin-tls.c
index 6279e0b7e4122..9a41c5c6a995a 100644
--- a/clang/test/Sema/darwin-tls.c
+++ b/clang/test/Sema/darwin-tls.c
@@ -1,18 +1,18 @@
 // RUN: not %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx10.6 %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx10.7 %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple x86_64-apple-macosx10.7 %s 2>&1 | FileCheck %s --check-prefix TLS
 
 // RUN: not %clang_cc1 -fsyntax-only -triple arm64-apple-ios7.1 %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple arm64-apple-ios8.0 %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple arm64-apple-ios8.0 %s 2>&1 | FileCheck %s --check-prefix TLS
 // RUN: not %clang_cc1 -fsyntax-only -triple thumbv7s-apple-ios8.3 %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple thumbv7s-apple-ios9.0 %s 2>&1 | FileCheck %s --check-prefix TLS
-// RUN: %clang_cc1 -fsyntax-only -triple armv7-apple-ios9.0 %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple thumbv7s-apple-ios9.0 %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple armv7-apple-ios9.0 %s 2>&1 | FileCheck %s --check-prefix TLS
 // RUN: not %clang_cc1 -fsyntax-only -triple i386-apple-ios9.0-simulator %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-ios10.0-simulator %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple i386-apple-ios10.0-simulator %s 2>&1 | FileCheck %s --check-prefix TLS
 
 // RUN: not %clang_cc1 -fsyntax-only -triple thumbv7k-apple-watchos1.0 %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple thumbv7k-apple-watchos2.0 %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple thumbv7k-apple-watchos2.0 %s 2>&1 | FileCheck %s --check-prefix TLS
 // RUN: not %clang_cc1 -fsyntax-only -triple i386-apple-watchos2.0-simulator %s 2>&1 | FileCheck %s --check-prefix NO-TLS
-// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-watchos3.0-simulator %s 2>&1 | FileCheck %s --check-prefix TLS
+// RUN: %clang_cc1 -fsyntax-only -Wno-error=implicit-int -triple i386-apple-watchos3.0-simulator %s 2>&1 | FileCheck %s --check-prefix TLS
 
 
 __thread int a;

diff  --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 3140bfb95dc82..b4ecc54559c7c 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -18,7 +18,7 @@ void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
 
 // PR1965
 int t5(b);          // expected-error {{parameter list without types}}
-int t6(int x, g);   // expected-warning {{type specifier missing, defaults to 'int'}}
+int t6(int x, g);   // expected-error {{type specifier missing, defaults to 'int'}}
 
 int t7(, );       // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
 int t8(, int a);  // expected-error {{expected parameter declarator}}
@@ -41,8 +41,8 @@ int t14() {
 }
 
 // <rdar://problem/6097326>
-y(y) { return y; } // expected-warning{{parameter 'y' was not declared, defaulting to type 'int'}} \
-                   // expected-warning{{type specifier missing, defaults to 'int'}}
+y(y) { return y; } // expected-error{{parameter 'y' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+                   // expected-error{{type specifier missing, defaults to 'int'}}
 
 
 // PR3137, <rdar://problem/6127293>

diff  --git a/clang/test/Sema/implicit-int.c b/clang/test/Sema/implicit-int.c
index 361f0d38920f8..477cd6977375b 100644
--- a/clang/test/Sema/implicit-int.c
+++ b/clang/test/Sema/implicit-int.c
@@ -1,16 +1,24 @@
-// RUN: %clang_cc1 -fsyntax-only %s -verify -pedantic -Wno-strict-prototypes
-
-foo(void) { // expected-warning {{type specifier missing, defaults to 'int'}}
+/* RUN: %clang_cc1 -fsyntax-only -std=c89 -Wimplicit-int %s -verify -Wno-strict-prototypes
+   RUN: %clang_cc1 -fsyntax-only -std=c99 %s -verify=ext -Wno-strict-prototypes
+   RUN: %clang_cc1 -fsyntax-only -std=c2x %s -verify=unsupported
+*/
+
+foo(void) { /* expected-warning {{type specifier missing, defaults to 'int'}} \
+               ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+               unsupported-error {{a type specifier is required for all declarations}} */
   return 0;
 }
 
-y;  // expected-warning {{type specifier missing, defaults to 'int'}}
-
-// rdar://6131634
-void f((x));  // expected-warning {{type specifier missing, defaults to 'int'}}
+y;  /* expected-warning {{type specifier missing, defaults to 'int'}} \
+       ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+       unsupported-error {{a type specifier is required for all declarations}} */
 
+/* rdar://6131634 */
+void f((x));  /* expected-warning {{type specifier missing, defaults to 'int'}} \
+                 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+                 unsupported-error {{a type specifier is required for all declarations}} */
 
-// PR3702
+/* PR3702 */
 #define PAD(ms10) { \
     register i;     \
 }
@@ -18,11 +26,18 @@ void f((x));  // expected-warning {{type specifier missing, defaults to 'int'}}
 #define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
 
 void
-h19_insline(n)  // expected-warning {{parameter 'n' was not declared, defaulting to type 'int'}}
+h19_insline(n)  /* ext-error {{parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+                   unsupported-error {{unknown type name 'n'}} */
 {
-  ILPAD();  // expected-warning {{type specifier missing, defaults to 'int'}}
+  ILPAD();  /* expected-warning {{type specifier missing, defaults to 'int'}} \
+               ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+               unsupported-error {{a type specifier is required for all declarations}} */
+
 }
 
 struct foo {
- __extension__ __attribute__((packed)) x : 4; // expected-warning {{type specifier missing, defaults to 'int'}}
+ __extension__ __attribute__((packed)) x : 4; /* expected-warning {{type specifier missing, defaults to 'int'}} \
+                                                 ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
+                                                 unsupported-error {{unknown type name 'x'}} */
+
 };

diff  --git a/clang/test/Sema/invalid-decl.c b/clang/test/Sema/invalid-decl.c
index 08da9bca2d50e..4f2680074dcd0 100644
--- a/clang/test/Sema/invalid-decl.c
+++ b/clang/test/Sema/invalid-decl.c
@@ -6,7 +6,7 @@ void test(void) {
 
 
 // PR2400
-typedef xtype (*x)(void* handle); // expected-error {{function cannot return function type}} expected-warning {{type specifier missing, defaults to 'int'}} expected-warning {{type specifier missing, defaults to 'int'}}
+typedef xtype (*x)(void* handle); // expected-error {{function cannot return function type}} expected-error 2{{type specifier missing, defaults to 'int'}}
 
 typedef void ytype();
 

diff  --git a/clang/test/Sema/invalid-struct-init.c b/clang/test/Sema/invalid-struct-init.c
index 000d3ab59dc55..72f6bbae12abd 100644
--- a/clang/test/Sema/invalid-struct-init.c
+++ b/clang/test/Sema/invalid-struct-init.c
@@ -3,8 +3,8 @@
 typedef struct _zend_module_entry zend_module_entry;
 struct _zend_module_entry {
   _efree((p)); // expected-error{{type name requires a specifier or qualifier}} \
-                  expected-warning {{type specifier missing, defaults to 'int'}}
-  
+                  expected-error {{type specifier missing, defaults to 'int'}}
+
 };
 typedef struct _zend_function_entry { } zend_function_entry;
 typedef struct _zend_pcre_globals { } zend_pcre_globals;
@@ -18,10 +18,10 @@ static int zm_startup_pcre(int type, int module_number ) { }
 static int zm_shutdown_pcre(int type, int module_number ) {
   zend_function_entry pcre_functions[] = {{ }; // expected-error{{expected '}'}} expected-note {{to match this '{'}}
   zend_module_entry pcre_module_entry = {
-    sizeof(zend_module_entry), 20071006, 0, 0, ((void *)0), ((void *)0),    
-    "pcre",  pcre_functions,  zm_startup_pcre,  zm_shutdown_pcre,  ((void *)0),  
-    ((void *)0),  zm_info_pcre,  ((void *)0),  sizeof(zend_pcre_globals), &pcre_globals,  
-    ((void (*)(void* ))(zm_globals_ctor_pcre)),  ((void (*)(void* ))(zm_globals_dtor_pcre)),  
-    ((void *)0),  0, 0, ((void *)0), 0 
+    sizeof(zend_module_entry), 20071006, 0, 0, ((void *)0), ((void *)0),
+    "pcre",  pcre_functions,  zm_startup_pcre,  zm_shutdown_pcre,  ((void *)0),
+    ((void *)0),  zm_info_pcre,  ((void *)0),  sizeof(zend_pcre_globals), &pcre_globals,
+    ((void (*)(void* ))(zm_globals_ctor_pcre)),  ((void (*)(void* ))(zm_globals_dtor_pcre)),
+    ((void *)0),  0, 0, ((void *)0), 0
   };
 }

diff  --git a/clang/test/Sema/redefinition.c b/clang/test/Sema/redefinition.c
index a16556300ba77..7e690e1a917d5 100644
--- a/clang/test/Sema/redefinition.c
+++ b/clang/test/Sema/redefinition.c
@@ -4,7 +4,7 @@ int f(int);
 int f(int a) { return 0; } // expected-error {{redefinition of 'f'}}
 
 // <rdar://problem/6097326>
-int foo(x) {
+int foo(x) { // expected-error {{parameter 'x' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
   return 0;
 }
 int x = 1;

diff  --git a/clang/test/Sema/return.c b/clang/test/Sema/return.c
index fc7d711b8ad80..14d5300e81949 100644
--- a/clang/test/Sema/return.c
+++ b/clang/test/Sema/return.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value -Wno-strict-prototypes
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -Wno-error=implicit-int -verify -fblocks -Wno-unreachable-code -Wno-unused-value -Wno-strict-prototypes
 
 // clang emits the following warning by default.
-// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the 
+// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
 // following warning.
 int t14(void) {
   return; // expected-warning {{non-void function 't14' should return a value}}
@@ -173,7 +173,7 @@ int test27(void) {
       goto done;
     }
     return 1;
-  case 4:    
+  case 4:
     while (0) { goto done; }
     return 1;
   case 5:
@@ -190,7 +190,7 @@ int test27(void) {
 
 // PR4624
 void test28() __attribute__((noreturn));
-void test28(x) { while (1) { } }
+void test28(x) { while (1) { } } // expected-warning {{parameter 'x' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
 
 void exit(int);
 int test29(void) {

diff  --git a/clang/test/Sema/typo-correction.c b/clang/test/Sema/typo-correction.c
index d69a2eb07da9e..ceab0e2634c5c 100644
--- a/clang/test/Sema/typo-correction.c
+++ b/clang/test/Sema/typo-correction.c
@@ -10,11 +10,11 @@ void PR21656(void) {
   x = (float)arst;  // expected-error-re {{use of undeclared identifier 'arst'{{$}}}}
 }
 
-a = b ? : 0;  // expected-warning {{type specifier missing, defaults to 'int'}} \
+a = b ? : 0;  // expected-error {{type specifier missing, defaults to 'int'}} \
               // expected-error {{use of undeclared identifier 'b'}}
 
 int foobar;  // expected-note {{'foobar' declared here}}
-new_a = goobar ?: 4; // expected-warning {{type specifier missing, defaults to 'int'}} \
+new_a = goobar ?: 4; // expected-error {{type specifier missing, defaults to 'int'}} \
                       // expected-error {{use of undeclared identifier 'goobar'; did you mean 'foobar'?}} \
                       // expected-error {{initializer element is not a compile-time constant}}
 

diff  --git a/clang/test/Sema/warn-strict-prototypes.c b/clang/test/Sema/warn-strict-prototypes.c
index c4cdf8e5668b6..c16073d0820eb 100644
--- a/clang/test/Sema/warn-strict-prototypes.c
+++ b/clang/test/Sema/warn-strict-prototypes.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -verify %s
-// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -Wno-error=implicit-int -verify %s
+// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -Wno-error=implicit-int -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 // function definition with 0 params, no prototype, no preceding declaration.
 void foo0() {} // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
@@ -59,7 +59,8 @@ void foo10(); // expected-warning {{a function declaration without a prototype i
                  expected-note {{a function declaration without a prototype is not supported in C2x}}
               // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:12-[[@LINE-2]]:12}:"void"
 // K&R function definition with incomplete param list declared
-void foo10(p, p2) void *p; {} // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void foo10(p, p2) void *p; {} // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x}} \
+                                 expected-warning {{parameter 'p2' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
 
 void foo11(int p, int p2);
 void foo11(p, p2) int p; int p2; {} // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x}}

diff  --git a/clang/test/SemaCXX/MicrosoftSuper.cpp b/clang/test/SemaCXX/MicrosoftSuper.cpp
index df63691812ac3..1d1460f74ffa6 100644
--- a/clang/test/SemaCXX/MicrosoftSuper.cpp
+++ b/clang/test/SemaCXX/MicrosoftSuper.cpp
@@ -7,7 +7,7 @@ struct Errors {
   void foo() {
     // expected-note at +4 {{replace parentheses with an initializer to declare a variable}}
     // expected-warning at +3 {{empty parentheses interpreted as a function declaration}}
-    // expected-error at +2 {{C++ requires a type specifier for all declarations}}
+    // expected-error at +2 {{a type specifier is required for all declarations}}
     // expected-error at +1 {{use of '__super' inside a lambda is unsupported}}
     auto lambda = []{ __super::foo(); };
   }

diff  --git a/clang/test/SemaCXX/PR9459.cpp b/clang/test/SemaCXX/PR9459.cpp
index 010e228f67628..9547a2ad5ee0f 100644
--- a/clang/test/SemaCXX/PR9459.cpp
+++ b/clang/test/SemaCXX/PR9459.cpp
@@ -3,5 +3,5 @@
 // Don't crash.
 
 template<typename>struct ae_same; // expected-note {{}}
-template<typename>struct ts{}ap() // expected-error {{expected ';' after struct}} expected-error {{requires a type specifier}}
+template<typename>struct ts{}ap() // expected-error {{expected ';' after struct}} expected-error {{a type specifier is required}}
 {ts<a>::ap<ae_same<int>::&ae_same<>>::p(a); }; // expected-error {{use of undeclared identifier 'a'}} expected-error 5{{}}

diff  --git a/clang/test/SemaCXX/PR9460.cpp b/clang/test/SemaCXX/PR9460.cpp
index 0dd844677053b..ab3528dbf08a4 100644
--- a/clang/test/SemaCXX/PR9460.cpp
+++ b/clang/test/SemaCXX/PR9460.cpp
@@ -1,17 +1,17 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 // Don't crash.
 
 template<typename aT>
 struct basic_string{
-  a; // expected-error {{requires a type specifier}}
+  a; // expected-error {{a type specifier is required}}
   basic_string(aT*);
 };
 
 struct runtime_error{
   runtime_error(
 basic_string<char> struct{ // expected-error {{cannot combine with previous 'type-name' declaration specifier}}
-a(){ // expected-error {{requires a type specifier}}
+a(){ // expected-error {{a type specifier is required}}
   runtime_error(0);
 }
 }

diff  --git a/clang/test/SemaCXX/PR9461.cpp b/clang/test/SemaCXX/PR9461.cpp
index f97a208192b60..1b82a97e74402 100644
--- a/clang/test/SemaCXX/PR9461.cpp
+++ b/clang/test/SemaCXX/PR9461.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 // Don't crash.
 
@@ -18,7 +18,7 @@ int _S_construct();
 
 int _S_construct(int);
 
-_S_construct(); // expected-error {{requires}}
+_S_construct(); // expected-error {{a type specifier is required}}
 };
 
 template<typename _CharT,typename _Traits,typename _Alloc>

diff  --git a/clang/test/SemaCXX/crashes.cpp b/clang/test/SemaCXX/crashes.cpp
index a80587d8405b3..785679c21f1fa 100644
--- a/clang/test/SemaCXX/crashes.cpp
+++ b/clang/test/SemaCXX/crashes.cpp
@@ -5,13 +5,13 @@
 // <rdar://problem/8124080>
 template<typename _Alloc> class allocator;
 template<class _CharT> struct char_traits;
-template<typename _CharT, typename _Traits = char_traits<_CharT>,            
+template<typename _CharT, typename _Traits = char_traits<_CharT>,
          typename _Alloc = allocator<_CharT> >
 class basic_string;
 template<typename _CharT, typename _Traits, typename _Alloc>
-const typename basic_string<_CharT, _Traits, _Alloc>::size_type   
+const typename basic_string<_CharT, _Traits, _Alloc>::size_type
 basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_max_size // expected-error{{no member named '_Rep' in 'basic_string<_CharT, _Traits, _Alloc>'}}
-  = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4; 
+  = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
 
 // PR7118
 template<typename T>
@@ -181,8 +181,8 @@ namespace pr16964 {
   template<typename> struct bs {
     bs();
     static int* member(); // expected-note{{possible target}}
-    member();  // expected-error{{C++ requires a type specifier for all declarations}}
-    static member();  // expected-error{{C++ requires a type specifier for all declarations}}
+    member();  // expected-error{{a type specifier is required for all declarations}}
+    static member();  // expected-error{{a type specifier is required for all declarations}}
     static int* member(int); // expected-note{{possible target}}
   };
 
@@ -237,7 +237,7 @@ namespace pr16989 {
 }
 
 namespace pr20660 {
- appendList(int[]...);     // expected-error {{C++ requires a type specifier for all declarations}}
- appendList(int[]...) { }  // expected-error {{C++ requires a type specifier for all declarations}}
+ appendList(int[]...);     // expected-error {{a type specifier is required for all declarations}}
+ appendList(int[]...) { }  // expected-error {{a type specifier is required for all declarations}}
 }
 

diff  --git a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
index ddc9c8a6b25bf..26f4bd3ed7a0a 100644
--- a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
+++ b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
@@ -8,10 +8,10 @@
   #define CONST constexpr
 #endif
 
-template<typename T> 
+template<typename T>
 T pi = T(3.1415926535897932385); // expected-note 2{{declared here}}
 
-template<typename T> 
+template<typename T>
 CONST T cpi = T(3.1415926535897932385); // expected-note {{template is declared here}}
 
 template<typename T> extern CONST T vc;
@@ -33,7 +33,7 @@ namespace use_in_top_level_funcs {
     int ipi = pi; // expected-error {{use of variable template 'pi' requires template arguments}}
     int icpi = cpi; // expected-error {{use of variable template 'cpi' requires template arguments}}
   }
-  
+
   template<typename T>
   T circular_area(T r) {
     return pi<T> * r * r;
@@ -79,13 +79,13 @@ namespace odr_tmpl {
 
     template<typename T> T v; // expected-note {{previous definition is here}}
     template<typename T> int v; // expected-error {{redefinition of 'v'}}
-    
+
     template<typename T> extern int v1; // expected-note {{previous template declaration is here}}
     template<int I> int v1;      // expected-error {{template parameter has a 
diff erent kind in template redeclaration}}
   }
   namespace pvt_use {
     template<typename T> T v;
-    v = 10;  // expected-error {{C++ requires a type specifier for all declarations}}
+    v = 10;  // expected-error {{a type specifier is required for all declarations}}
   }
 
   namespace pvt_
diff _params {
@@ -121,36 +121,36 @@ namespace odr_tmpl {
     template<typename T> extern auto v4;   // expected-error {{declaration of variable 'v4' with deduced type 'auto' requires an initializer}}
   }
 #endif
-  
+
 }
 
 namespace explicit_instantiation {
-  template<typename T> 
+  template<typename T>
   T pi0a = T(3.1415926535897932385);  // expected-note {{variable template 'pi0a' declared here}}
   template float pi0a<int>; // expected-error {{type 'float' of explicit instantiation of 'pi0a' does not match expected type 'int'}}
 
-  template<typename T> 
+  template<typename T>
   T pi0b = T(3.1415926535897932385);  // expected-note {{variable template 'pi0b' declared here}}
   template CONST int pi0b<int>; // expected-error {{type 'const int' of explicit instantiation of 'pi0b' does not match expected type 'int'}}
 
-  template<typename T> 
+  template<typename T>
   T pi0c = T(3.1415926535897932385);  // expected-note {{variable template 'pi0c' declared here}}
   template int pi0c<const int>;  // expected-error {{type 'int' of explicit instantiation of 'pi0c' does not match expected type 'const int'}}
 
-  template<typename T> 
+  template<typename T>
   T pi0 = T(3.1415926535897932385);
   template int pi0<int>;   // expected-note {{previous explicit instantiation is here}}
   template int pi0<int>;   // expected-error {{duplicate explicit instantiation of 'pi0<int>'}}
 
-  template<typename T> 
+  template<typename T>
   CONST T pi1a = T(3.1415926535897932385);  // expected-note {{variable template 'pi1a' declared here}}
   template int pi1a<int>; // expected-error {{type 'int' of explicit instantiation of 'pi1a' does not match expected type 'const int'}}
 
-  template<typename T> 
+  template<typename T>
   CONST T pi1b = T(3.1415926535897932385);  // expected-note {{variable template 'pi1b' declared here}}
   template int pi1b<const int>;  // expected-error {{type 'int' of explicit instantiation of 'pi1b' does not match expected type 'const const int'}}
 
-  template<typename T> 
+  template<typename T>
   CONST T pi1 = T(3.1415926535897932385);
   template CONST int pi1<int>;   // expected-note {{previous explicit instantiation is here}}
   template CONST int pi1<int>;   // expected-error {{duplicate explicit instantiation of 'pi1<int>'}}
@@ -159,7 +159,7 @@ namespace explicit_instantiation {
   namespace auto_var {
     template<typename T> auto var0 = T();
     template auto var0<int>;    // expected-error {{'auto' variable template instantiation is not allowed}}
-    
+
     template<typename T> auto var = T();
     template int var<int>;
   }
@@ -187,7 +187,7 @@ namespace explicit_specialization {
 
     template<> CONST int pi2<int,int> = 4;
 
-#ifndef PRECXX11   
+#ifndef PRECXX11
     void foo() {
       static_assert(pi2<int,int> == 4, "");
       static_assert(pi2<float,int> == 2, "");
@@ -209,15 +209,15 @@ namespace explicit_specialization {
 
     template<typename T>
     CONST int pi2<int,T> = 3; // expected-note {{partial specialization matches [with T = int]}}
-    
+
     void foo() {
       int a = pi2<int,int>;  // expected-error {{ambiguous partial specializations of 'pi2<int, int>'}}
     }
   }
-  
+
   namespace type_changes {
 
-    template<typename T> 
+    template<typename T>
     T pi0 = T(3.1415926535897932385);
 
     template<> float pi0<int> = 10;
@@ -252,15 +252,15 @@ namespace explicit_specialization {
 #endif
 
 
-    template<typename T> 
+    template<typename T>
     CONST T pi1 = T(3.1415926535897932385);
 
     template<> CONST int pi1<int> = 10;   // expected-note {{previous definition is here}}
     template<> CONST int pi1<int> = 10;   // expected-error {{redefinition of 'pi1<int>'}}
   }
-  
+
   namespace before_instantiation {
-    template<typename T> 
+    template<typename T>
     T pi0 = T(3.1415926535897932385);   // expected-note {{variable template 'pi0' declared here}}
 
     template<> int pi0<int> = 10; // expected-note 2{{previous template specialization is here}}
@@ -274,7 +274,7 @@ namespace explicit_specialization {
     template CONST int pi2<int,int>;
   }
   namespace after_instantiation {
-    template<typename T> 
+    template<typename T>
     T pi0 = T(3.1415926535897932385);
 
     template int pi0<int>;   // expected-note 2{{explicit instantiation first required here}}
@@ -304,11 +304,11 @@ namespace explicit_specialization {
     }
   }
 #endif
-  
+
   namespace extern_var {
     // TODO:
   }
-  
+
   namespace 
diff _type {
     // TODO:
     template<typename T> T* var = new T();
@@ -343,7 +343,7 @@ namespace arrays {
 
   float f = 10.5;
   template<> float* arr<float> = &f;
-  
+
   void bar() {
     int *iarr = arr<int>;
     iarr[0] = 1;
@@ -357,48 +357,48 @@ namespace arrays {
 #endif
 
 namespace nested {
-  
+
   namespace n0a {
-    template<typename T> 
+    template<typename T>
     T pi0a = T(3.1415926535897932385);
   }
-  
+
   using namespace n0a;
   int i0a = pi0a<int>;
-  
+
   template float pi0a<float>;
   float f0a = pi0a<float>;
-  
+
   template<> double pi0a<double> = 5.2;
   double d0a = pi0a<double>;
 
   namespace n0b {
-    template<typename T> 
+    template<typename T>
     T pi0b = T(3.1415926535897932385);
   }
-  
+
   int i0b = n0b::pi0b<int>;
-  
+
   template float n0b::pi0b<float>;
   float f0b = n0b::pi0b<float>;
-  
+
   template<> double n0b::pi0b<double> = 5.2;
   double d0b = n0b::pi0b<double>;
-  
+
   namespace n1 {
-    template<typename T> 
+    template<typename T>
     T pi1a = T(3.1415926535897932385); // expected-note {{explicitly specialized declaration is here}}
 #ifndef PRECXX11
 // expected-note at -2 {{explicit instantiation refers here}}
 #endif
 
-    template<typename T> 
+    template<typename T>
     T pi1b = T(3.1415926535897932385); // expected-note {{explicitly specialized declaration is here}}
 #ifndef PRECXX11
 // expected-note at -2 {{explicit instantiation refers here}}
 #endif
   }
-  
+
   namespace use_n1a {
     using namespace n1;
     int i1 = pi1a<int>;
@@ -408,20 +408,20 @@ namespace nested {
 // expected-error at -2 {{explicit instantiation of 'pi1a<float>' not in a namespace enclosing 'n1'}}
 #endif
     float f1 = pi1a<float>;
-    
+
     template<> double pi1a<double> = 5.2; // expected-error {{not in a namespace enclosing 'n1'}}
     double d1 = pi1a<double>;
   }
-  
+
   namespace use_n1b {
     int i1 = n1::pi1b<int>;
-    
+
     template float n1::pi1b<float>;
 #ifndef PRECXX11
 // expected-error at -2 {{explicit instantiation of 'pi1b<float>' not in a namespace enclosing 'n1'}}
 #endif
     float f1 = n1::pi1b<float>;
-    
+
     template<> double n1::pi1b<double> = 5.2;  // expected-error {{not in a namespace enclosing 'n1'}}
     double d1 = n1::pi1b<double>;
   }
@@ -451,7 +451,7 @@ namespace PR19169 {
   template <typename T> int* f();
   template <typename T> void f();
   template<> int f<double>; // expected-error {{no variable template matches specialization; did you mean to use 'f' as function template instead?}}
-  
+
   template <typename T> void g();
   template<> int g<double>; // expected-error {{no variable template matches specialization; did you mean to use 'g' as function template instead?}}
 }

diff  --git a/clang/test/SemaCXX/for-range-crash.cpp b/clang/test/SemaCXX/for-range-crash.cpp
index 766f34e50ed43..ff84e3472b85f 100644
--- a/clang/test/SemaCXX/for-range-crash.cpp
+++ b/clang/test/SemaCXX/for-range-crash.cpp
@@ -8,7 +8,7 @@ error e; // expected-error {{unknown type name}}
 template <typename>
 class Bar {
   Bar<int> *variables_to_modify;
-  foo() { // expected-error {{C++ requires a type specifier for all declarations}}
+  foo() { // expected-error {{a type specifier is required for all declarations}}
     for (auto *c : *variables_to_modify)
       delete c;
   }

diff  --git a/clang/test/SemaCXX/implicit-int.cpp b/clang/test/SemaCXX/implicit-int.cpp
index 9711adf34304e..31cc20986c0a8 100644
--- a/clang/test/SemaCXX/implicit-int.cpp
+++ b/clang/test/SemaCXX/implicit-int.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-x; // expected-error{{C++ requires a type specifier for all declarations}}
+x; // expected-error{{a type specifier is required for all declarations}}
 
-f(int y) { return y; } // expected-error{{C++ requires a type specifier for all declarations}}
+f(int y) { return y; } // expected-error{{a type specifier is required for all declarations}}

diff  --git a/clang/test/SemaCXX/lambda-invalid-capture.cpp b/clang/test/SemaCXX/lambda-invalid-capture.cpp
index c9bd0d786cab5..236753871d701 100644
--- a/clang/test/SemaCXX/lambda-invalid-capture.cpp
+++ b/clang/test/SemaCXX/lambda-invalid-capture.cpp
@@ -2,7 +2,7 @@
 // Don't crash.
 
 struct g {
-  j; // expected-error {{C++ requires a type specifier for all declarations}}
+  j; // expected-error {{a type specifier is required for all declarations}}
 };
 
 void captures_invalid_type() {

diff  --git a/clang/test/SemaCXX/pr18284-crash-on-invalid.cpp b/clang/test/SemaCXX/pr18284-crash-on-invalid.cpp
index 5b1cb21f4bb6b..c6e877b0ee622 100644
--- a/clang/test/SemaCXX/pr18284-crash-on-invalid.cpp
+++ b/clang/test/SemaCXX/pr18284-crash-on-invalid.cpp
@@ -5,7 +5,7 @@ namespace n1 {
 class A { };
 class C { A a; };
 
-A::RunTest() {} // expected-error {{C++ requires a type specifier for all declarations}}
+A::RunTest() {} // expected-error {{a type specifier is required for all declarations}}
 
 void f() {
   new C;
@@ -16,7 +16,7 @@ namespace n2 {
 class A { };
 class C : public A { };
 
-A::RunTest() {} // expected-error {{C++ requires a type specifier for all declarations}}
+A::RunTest() {} // expected-error {{a type specifier is required for all declarations}}
 
 void f() {
   new C;

diff  --git a/clang/test/SemaCXX/typo-correction-delayed.cpp b/clang/test/SemaCXX/typo-correction-delayed.cpp
index 66d19daf66fd3..fdb1f740fda6a 100644
--- a/clang/test/SemaCXX/typo-correction-delayed.cpp
+++ b/clang/test/SemaCXX/typo-correction-delayed.cpp
@@ -159,7 +159,7 @@ __typeof blur y;  // expected-error {{use of undeclared identifier 'blur'; did y
 }
 
 namespace PR22092 {
-a = b ? : 0;  // expected-error {{C++ requires a type specifier for all declarations}} \
+a = b ? : 0;  // expected-error {{a type specifier is required for all declarations}} \
               // expected-error-re {{use of undeclared identifier 'b'{{$}}}}
 }
 

diff  --git a/clang/test/SemaCXX/typo-correction.cpp b/clang/test/SemaCXX/typo-correction.cpp
index 7eca5d80770da..60141ee13d597 100644
--- a/clang/test/SemaCXX/typo-correction.cpp
+++ b/clang/test/SemaCXX/typo-correction.cpp
@@ -494,7 +494,7 @@ template <typename T> struct Wrappable {
 // instead of incorrectly suggesting dropping "PR18213::WrapperInfo::".
 template <>
 PR18213::WrapperInfo ::PR18213::Wrappable<int>::kWrapperInfo = { 0 };  // expected-error {{no member named 'PR18213' in 'PR18213::WrapperInfo'; did you mean simply 'PR18213'?}} \
-                                                                       // expected-error {{C++ requires a type specifier for all declarations}}
+                                                                       // expected-error {{a type specifier is required for all declarations}}
 }
 
 namespace PR18651 {

diff  --git a/clang/test/SemaCXX/unknown-type-name.cpp b/clang/test/SemaCXX/unknown-type-name.cpp
index bacdee4b3703f..6fc3137088287 100644
--- a/clang/test/SemaCXX/unknown-type-name.cpp
+++ b/clang/test/SemaCXX/unknown-type-name.cpp
@@ -116,4 +116,4 @@ template<typename T> int i(T::type, int());
 // FIXME: We know which type specifier should have been specified here. Provide
 //        a fix-it to add 'typename A<T>::type'
 template<typename T>
-A<T>::g() { } // expected-error{{requires a type specifier}}
+A<T>::g() { } // expected-error{{a type specifier is required}}

diff  --git a/clang/test/SemaObjC/protocols.m b/clang/test/SemaObjC/protocols.m
index eb27341007691..ebb9b634b4b61 100644
--- a/clang/test/SemaObjC/protocols.m
+++ b/clang/test/SemaObjC/protocols.m
@@ -62,6 +62,6 @@ @protocol B < A > // expected-error{{protocol has circular dependency}}
 @end
 
 @protocol P
-- (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \
+- (int)test:(int)param, ..; // expected-error{{type specifier missing}} \
                       // expected-error{{expected ';' after method prototype}}
 @end

diff  --git a/clang/test/SemaObjCXX/crash.mm b/clang/test/SemaObjCXX/crash.mm
index a9754b7bc540d..6a7f0fbfc6600 100644
--- a/clang/test/SemaObjCXX/crash.mm
+++ b/clang/test/SemaObjCXX/crash.mm
@@ -42,21 +42,21 @@ @protocol InvalidProperties
 // expected-error at -1 {{type name requires a specifier or qualifier}}
 // expected-error at -2 {{property requires fields to be named}}
 // expected-error at -3 {{expected ';' at end of declaration list}}
-// expected-error at -4 {{C++ requires a type specifier for all declarations}}
+// expected-error at -4 {{a type specifier is required for all declarations}}
 // expected-error at -5 {{cannot declare variable inside @interface or @protocol}}
 
 @property (nonatomic) (ns::InnerType) invalidTypeParens2;
 // expected-error at -1 {{type name requires a specifier or qualifier}}
 // expected-error at -2 {{property requires fields to be named}}
 // expected-error at -3 {{expected ';' at end of declaration list}}
-// expected-error at -4 {{C++ requires a type specifier for all declarations}}
+// expected-error at -4 {{a type specifier is required for all declarations}}
 // expected-error at -5 {{cannot declare variable inside @interface or @protocol}}
 
 @property (nonatomic) int OuterType::InnerType; // expected-error {{property requires fields to be named}}
 
 @property (nonatomic) int OuterType::InnerType foo; // expected-error {{property requires fields to be named}}
 // expected-error at -1 {{expected ';' at end of declaration list}}
-// expected-error at -2 {{C++ requires a type specifier for all declarations}}
+// expected-error at -2 {{a type specifier is required for all declarations}}
 // expected-error at -3 {{cannot declare variable inside @interface or @protocol}}
 
 @end

diff  --git a/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl b/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
index 9e2869af87b4e..2ea6d3bc4862d 100644
--- a/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
+++ b/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
@@ -10,7 +10,7 @@ void foo(read_only pipe int p);
 // expected-error at -5 {{C++ for OpenCL version 2021 does not support the 'pipe' type qualifier}}
 // expected-error at -6 {{access qualifier can only be used for pipe and image type}}
 #else
-// expected-warning at -8 {{type specifier missing, defaults to 'int'}}
+// expected-error at -8 {{type specifier missing, defaults to 'int'}}
 // expected-error at -9 {{access qualifier can only be used for pipe and image type}}
 // expected-error at -10 {{expected ')'}} expected-note at -10 {{to match this '('}}
 #endif

diff  --git a/clang/test/SemaTemplate/address_space-dependent.cpp b/clang/test/SemaTemplate/address_space-dependent.cpp
index de23e694d6d16..682ab75c76924 100644
--- a/clang/test/SemaTemplate/address_space-dependent.cpp
+++ b/clang/test/SemaTemplate/address_space-dependent.cpp
@@ -9,7 +9,7 @@ void car() {
   __attribute__((address_space(J))) int array[5];     // expected-error {{automatic variable qualified with an address space}}
   __attribute__((address_space(I))) int arrarr[5][5]; // expected-error {{automatic variable qualified with an address space}}
 
-  __attribute__((address_space(J))) * x; // expected-error {{C++ requires a type specifier for all declarations}}
+  __attribute__((address_space(J))) * x; // expected-error {{a type specifier is required for all declarations}}
 
   __attribute__((address_space(I))) float *B;
 
@@ -89,12 +89,12 @@ template <unsigned B> int __attribute__((address_space(B+1))) *
diff erent_templat
 void test_
diff erent_template() { (void) 
diff erent_template<0>(); } // expected-error {{call to '
diff erent_template' is ambiguous}}
 
 template <typename T> struct partial_spec_deduce_as;
-template <typename T, unsigned AS> 
+template <typename T, unsigned AS>
 struct partial_spec_deduce_as <__attribute__((address_space(AS))) T *> {
-   static const unsigned value = AS;  
-}; 
+   static const unsigned value = AS;
+};
 
-int main() {  
+int main() {
   int __attribute__((address_space(1))) * p1;
   int p = GetAddressSpaceValue(p1);
 
@@ -112,8 +112,8 @@ int main() {
   ff.get_0(); // expected-note {{in instantiation of member function 'fooFunction<1>::get_0' requested here}}
   ff.qf();
   ff.test3(); // expected-note {{in instantiation of member function 'fooFunction<1>::test3' requested here}}
-  
-  static_assert(partial_spec_deduce_as<int __attribute__((address_space(3))) *>::value == 3, "address space value has been incorrectly deduced"); 
+
+  static_assert(partial_spec_deduce_as<int __attribute__((address_space(3))) *>::value == 3, "address space value has been incorrectly deduced");
 
   return 0;
 }

diff  --git a/clang/test/SemaTemplate/derived.cpp b/clang/test/SemaTemplate/derived.cpp
index d95e577fb21c0..51e4db3b36f66 100644
--- a/clang/test/SemaTemplate/derived.cpp
+++ b/clang/test/SemaTemplate/derived.cpp
@@ -14,7 +14,7 @@ void test() {
 
 namespace rdar13267210 {
   template < typename T > class A {
-    BaseTy; // expected-error{{C++ requires a type specifier for all declarations}}
+    BaseTy; // expected-error{{a type specifier is required for all declarations}}
   };
 
   template < typename T, int N > class C: A < T > {};

diff  --git a/clang/test/SemaTemplate/temp_arg_template.cpp b/clang/test/SemaTemplate/temp_arg_template.cpp
index 37e1e52521263..3ab847285ac84 100644
--- a/clang/test/SemaTemplate/temp_arg_template.cpp
+++ b/clang/test/SemaTemplate/temp_arg_template.cpp
@@ -19,7 +19,7 @@ namespace N {
 template<class, class> struct TooMany; // expected-note{{too many template parameters in template template argument}}
 
 
-A<X> *a1; 
+A<X> *a1;
 A<N::Z> *a2;
 A< ::N::Z> *a3;
 
@@ -42,19 +42,19 @@ A<::N::Z> *a10;
 
 // Do not do a digraph correction here.
 A<: :N::Z> *a11;  // expected-error{{expected expression}} \
-          expected-error{{C++ requires a type specifier for all declarations}}
+                     expected-error{{a type specifier is required for all declarations}}
 
 // PR7807
 namespace N {
-  template <typename, typename = int> 
+  template <typename, typename = int>
   struct X
   { };
 
-  template <typename ,int> 
+  template <typename ,int>
   struct Y
   { X<int> const_ref(); };
 
-  template <template<typename,int> class TT, typename T, int N> 
+  template <template<typename,int> class TT, typename T, int N>
   int operator<<(int, TT<T, N> a) { // expected-note{{candidate template ignored}}
     0 << a.const_ref(); // expected-error{{invalid operands to binary expression ('int' and 'X<int>')}}
   }

diff  --git a/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp b/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
index 4859372008ef9..762c89e9e52aa 100644
--- a/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
+++ b/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
@@ -6,7 +6,7 @@
 // RUN: cd %t/abc/def2
 // RUN: env PWD="%t/abc/def" not clang-check "ijk/qwe/test.cpp" 2>&1 | FileCheck %s
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 // CHECK: /abc/def/ijk/qwe/test.cpp
 invalid;
 

diff  --git a/clang/test/Tooling/auto-detect-from-source-parent.cpp b/clang/test/Tooling/auto-detect-from-source-parent.cpp
index 830d09d6a0e02..45075f4cd06e8 100644
--- a/clang/test/Tooling/auto-detect-from-source-parent.cpp
+++ b/clang/test/Tooling/auto-detect-from-source-parent.cpp
@@ -4,5 +4,5 @@
 // RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
 // RUN: not clang-check "%t/abc/def/ijk/qwe/test.cpp" 2>&1 | FileCheck %s
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-args.cpp b/clang/test/Tooling/clang-check-args.cpp
index 202b237118657..d75f6b8ccd6ad 100644
--- a/clang/test/Tooling/clang-check-args.cpp
+++ b/clang/test/Tooling/clang-check-args.cpp
@@ -1,4 +1,4 @@
 // RUN: not clang-check "%s" -- -c 2>&1 | FileCheck %s
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-autodetect-dir.cpp b/clang/test/Tooling/clang-check-autodetect-dir.cpp
index b84f3fede8884..889818e695900 100644
--- a/clang/test/Tooling/clang-check-autodetect-dir.cpp
+++ b/clang/test/Tooling/clang-check-autodetect-dir.cpp
@@ -5,5 +5,5 @@
 // RUN: not clang-check -p "%t/abc/def" "%t/test.cpp" 2>&1|FileCheck %s
 // FIXME: Make the above easier.
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-builtin-headers.cpp b/clang/test/Tooling/clang-check-builtin-headers.cpp
index 76fc9c4b3d015..3849f30f02a3b 100644
--- a/clang/test/Tooling/clang-check-builtin-headers.cpp
+++ b/clang/test/Tooling/clang-check-builtin-headers.cpp
@@ -8,5 +8,5 @@
 
 #include <stddef.h>
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-chdir.cpp b/clang/test/Tooling/clang-check-chdir.cpp
index fbe8a19aa1524..eea60f155cbaf 100644
--- a/clang/test/Tooling/clang-check-chdir.cpp
+++ b/clang/test/Tooling/clang-check-chdir.cpp
@@ -10,5 +10,5 @@
 
 #include "clang-check-test.h"
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-pwd.cpp b/clang/test/Tooling/clang-check-pwd.cpp
index fe2e1e98e6255..2e8d4a3fe12b6 100644
--- a/clang/test/Tooling/clang-check-pwd.cpp
+++ b/clang/test/Tooling/clang-check-pwd.cpp
@@ -7,7 +7,7 @@
 // RUN: env PWD="%t.foobar" not clang-check -p "%t" "test.cpp" 2>&1|FileCheck %s
 // FIXME: Make the above easier.
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 // CHECK: .foobar/test.cpp
 invalid;
 

diff  --git a/clang/test/Tooling/clang-check-rel-path.cpp b/clang/test/Tooling/clang-check-rel-path.cpp
index 23a9345b99b3b..5ea28598cc0d7 100644
--- a/clang/test/Tooling/clang-check-rel-path.cpp
+++ b/clang/test/Tooling/clang-check-rel-path.cpp
@@ -6,5 +6,5 @@
 // RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
 // FIXME: Make the above easier.
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check-strip-o.cpp b/clang/test/Tooling/clang-check-strip-o.cpp
index e33367bea54b7..156f15a0e60bd 100644
--- a/clang/test/Tooling/clang-check-strip-o.cpp
+++ b/clang/test/Tooling/clang-check-strip-o.cpp
@@ -7,5 +7,5 @@
 
 // CHECK: Invocation
 // CHECK-NOT: {{ -v}}
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/clang-check.cpp b/clang/test/Tooling/clang-check.cpp
index e3fb49c41772a..0bc821f9916d2 100644
--- a/clang/test/Tooling/clang-check.cpp
+++ b/clang/test/Tooling/clang-check.cpp
@@ -5,5 +5,5 @@
 // RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
 // FIXME: Make the above easier.
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/test/Tooling/multi-jobs.cpp b/clang/test/Tooling/multi-jobs.cpp
index 980ade41fdf6f..e9716d04bdb18 100644
--- a/clang/test/Tooling/multi-jobs.cpp
+++ b/clang/test/Tooling/multi-jobs.cpp
@@ -2,5 +2,5 @@
 // The following test uses multiple time the same '-no-integrated-as' flag in order to make sure those flags are really skipped, and not just overwritten by luck :
 // RUN: not clang-check "%s" -- -target x86_64-win32 -c -no-integrated-as -no-integrated-as -no-integrated-as 2>&1 | FileCheck %s
 
-// CHECK: C++ requires
+// CHECK: a type specifier is required
 invalid;

diff  --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp
index 28205c212f61d..18054d3916c36 100644
--- a/clang/unittests/AST/SourceLocationTest.cpp
+++ b/clang/unittests/AST/SourceLocationTest.cpp
@@ -135,13 +135,19 @@ TEST(LabelStmt, Range) {
 TEST(ParmVarDecl, KNRLocation) {
   LocationVerifier<ParmVarDecl> Verifier;
   Verifier.expectLocation(1, 8);
-  EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C99));
+  EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C89));
+
+  Verifier.expectLocation(1, 15);
+  EXPECT_TRUE(Verifier.match("void f(i) int i; {}", varDecl(), Lang_C99));
 }
 
 TEST(ParmVarDecl, KNRRange) {
   RangeVerifier<ParmVarDecl> Verifier;
   Verifier.expectRange(1, 8, 1, 8);
-  EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C99));
+  EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C89));
+
+  Verifier.expectRange(1, 11, 1, 15);
+  EXPECT_TRUE(Verifier.match("void f(i) int i; {}", varDecl(), Lang_C99));
 }
 
 TEST(CXXNewExpr, ArrayRange) {


        


More information about the cfe-commits mailing list