Index: clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp +++ 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] Index: clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp +++ clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp @@ -20,7 +20,7 @@ // 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 @@ // 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: [] Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -162,7 +162,17 @@ ``-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``. Index: clang/include/clang/Basic/DiagnosticCommonKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticCommonKinds.td +++ clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -123,7 +123,9 @@ def warn_cxx20_compat_consteval : Warning< "'consteval' specifier is incompatible with C++ standards before C++20">, InGroup, DefaultIgnore; - +def warn_missing_type_specifier : Warning< + "type specifier missing, defaults to 'int'">, + InGroup, DefaultIgnore; } let CategoryName = "Nullability Issue" in { Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -4341,8 +4341,9 @@ "'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, DefaultError; def err_param_default_argument : Error< "C does not support default arguments">; def err_param_default_argument_redefinition : Error< @@ -9997,15 +9998,13 @@ "receiver %0 is a forward class and corresponding @interface may not exist">, InGroup; 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; + "type specifier missing, defaults to 'int'; ISO C99 and later do not support " + "implicit int">, InGroup, 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< Index: clang/include/clang/Basic/LangOptions.h =================================================================== --- clang/include/clang/Basic/LangOptions.h +++ clang/include/clang/Basic/LangOptions.h @@ -527,6 +527,12 @@ return CPlusPlus || C2x || DisableKNRFunctions; } + /// Returns true if implicit int is part of the language requirements. + bool requiresImplicitInt() const { return !CPlusPlus && !C99; } + + /// Returns true if implicit int is supported at all. + bool implicitIntEnabled() const { return !CPlusPlus && !C2x; } + /// Check if return address signing is enabled. bool hasSignReturnAddress() const { return getSignReturnAddressScope() != SignReturnAddressScopeKind::None; Index: clang/include/clang/Basic/LangOptions.def =================================================================== --- clang/include/clang/Basic/LangOptions.def +++ clang/include/clang/Basic/LangOptions.def @@ -120,7 +120,6 @@ 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") Index: clang/include/clang/Basic/LangStandard.h =================================================================== --- clang/include/clang/Basic/LangStandard.h +++ clang/include/clang/Basic/LangStandard.h @@ -59,9 +59,8 @@ 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 @@ /// 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; } Index: clang/include/clang/Basic/LangStandards.def =================================================================== --- clang/include/clang/Basic/LangStandards.def +++ 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 Index: clang/lib/Basic/LangOptions.cpp =================================================================== --- clang/lib/Basic/LangOptions.cpp +++ clang/lib/Basic/LangOptions.cpp @@ -113,7 +113,6 @@ Opts.GNUMode = Std.isGNUMode(); Opts.GNUCVersion = 0; Opts.HexFloats = Std.hasHexFloats(); - Opts.ImplicitInt = Std.hasImplicitInt(); Opts.WChar = Std.isCPlusPlus(); Opts.Digraphs = Std.hasDigraphs(); Index: clang/lib/Parse/ParseDecl.cpp =================================================================== --- clang/lib/Parse/ParseDecl.cpp +++ clang/lib/Parse/ParseDecl.cpp @@ -2637,8 +2637,8 @@ // 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().implicitIntEnabled() && 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 Index: clang/lib/Parse/Parser.cpp =================================================================== --- clang/lib/Parse/Parser.cpp +++ clang/lib/Parse/Parser.cpp @@ -1198,7 +1198,9 @@ // If this is C90 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().requiresImplicitInt() && 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(); Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -14312,25 +14312,35 @@ 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. AttributeFactory attrs; DeclSpec DS(attrs); - const char* PrevSpec; // unused - unsigned DiagID; // unused + const char *PrevSpec; // unused + unsigned DiagID; // unused DS.SetTypeSpecType(DeclSpec::TST_int, FTI.Params[i].IdentLoc, PrevSpec, DiagID, Context.getPrintingPolicy()); // Use the identifier location for the type source range. Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1356,35 +1356,34 @@ // 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().requiresImplicitInt()) { + 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().implicitIntEnabled() && !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().implicitIntEnabled() && + "implicit int is disabled?"); S.Diag(DeclLoc, diag::ext_missing_type_specifier) - << DS.getSourceRange(); + << DS.getSourceRange() + << FixItHint::CreateInsertion(DS.getBeginLoc(), "int"); } } Index: clang/test/Analysis/PR49642.c =================================================================== --- clang/test/Analysis/PR49642.c +++ 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 Index: clang/test/Analysis/inline-unique-reports.c =================================================================== --- clang/test/Analysis/inline-unique-reports.c +++ 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) { Index: clang/test/Analysis/malloc.c =================================================================== --- clang/test/Analysis/malloc.c +++ 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 \ Index: clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp =================================================================== --- clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp +++ clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp @@ -7,7 +7,7 @@ // 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); Index: clang/test/CXX/drs/dr2xx.cpp =================================================================== --- clang/test/CXX/drs/dr2xx.cpp +++ clang/test/CXX/drs/dr2xx.cpp @@ -1094,7 +1094,7 @@ 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}} Index: clang/test/CXX/drs/dr4xx.cpp =================================================================== --- clang/test/CXX/drs/dr4xx.cpp +++ clang/test/CXX/drs/dr4xx.cpp @@ -1054,7 +1054,7 @@ 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; } Index: clang/test/CXX/drs/dr5xx.cpp =================================================================== --- clang/test/CXX/drs/dr5xx.cpp +++ clang/test/CXX/drs/dr5xx.cpp @@ -162,7 +162,7 @@ template void b3(Base *); 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 @@ // 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 @@ // 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 @@ struct A { friend T; #if __cplusplus <= 201402L - // expected-error@-2 {{requires a type specifier}} expected-error@-2 {{can only be classes or functions}} + // expected-error@-2 {{a type specifier is required}} expected-error@-2 {{can only be classes or functions}} #else // expected-error@-4 {{use of class template 'T' requires template arguments; argument deduction not allowed in friend declaration}} // expected-note@-7 {{here}} @@ -891,7 +891,7 @@ template class T> struct B { friend T; #if __cplusplus <= 201402L - // expected-error@-2 {{requires a type specifier}} expected-error@-2 {{can only be classes or functions}} + // expected-error@-2 {{a type specifier is required}} expected-error@-2 {{can only be classes or functions}} #else // expected-error@-4 {{use of template template parameter 'T' requires template arguments; argument deduction not allowed in friend declaration}} // expected-note@-6 {{here}} Index: clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp =================================================================== --- clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp +++ clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp @@ -36,7 +36,7 @@ // expected-error@-2 {{redefinition of module 'x'}} // expected-note-re@module-declaration.cpp:* {{loaded from '{{.*[/\\]}}x.pcm'}} #elif TEST == 7 -// expected-error@-5 {{expected ';'}} expected-error@-5 {{requires a type specifier}} +// expected-error@-5 {{expected ';'}} expected-error@-5 {{a type specifier is required}} #elif TEST == 9 // expected-warning@-7 {{unknown attribute 'fancy' ignored}} #elif TEST == 10 Index: clang/test/CXX/temp/p3.cpp =================================================================== --- clang/test/CXX/temp/p3.cpp +++ clang/test/CXX/temp/p3.cpp @@ -10,7 +10,7 @@ expected-error {{use of undeclared identifier 'T'}} template struct B { } f(); // expected-error {{expected ';' after struct}} \ - expected-error {{requires a type specifier}} + expected-error {{a type specifier is required}} template struct C { } // expected-error {{expected ';' after struct}} Index: clang/test/CXX/temp/temp.deduct.guide/p3.cpp =================================================================== --- clang/test/CXX/temp/temp.deduct.guide/p3.cpp +++ clang/test/CXX/temp/temp.deduct.guide/p3.cpp @@ -24,9 +24,9 @@ B() -> B; // expected-error {{cannot specify deduction guide for alias template 'B'}} // FIXME: expected-error@-1 {{declarator requires an identifier}} template int C; -C() -> int; // expected-error {{requires a type specifier}} +C() -> int; // expected-error {{a type specifier is required}} template void D(); -D() -> int; // expected-error {{requires a type specifier}} +D() -> int; // expected-error {{a type specifier is required}} template typename TT> struct E { // expected-note 2{{template}} // FIXME: Should only diagnose this once! TT(int) -> TT; // expected-error 2{{cannot specify deduction guide for template template parameter 'TT'}} expected-error {{requires an identifier}} Index: clang/test/CXX/temp/temp.res/temp.local/p3.cpp =================================================================== --- clang/test/CXX/temp/temp.res/temp.local/p3.cpp +++ clang/test/CXX/temp/temp.res/temp.local/p3.cpp @@ -4,7 +4,7 @@ // expected-note@-1 2{{member type 'Base' found by ambiguous name lookup}} // expected-note@-2 2{{member type 'Base' found by ambiguous name lookup}} static void f(); -}; +}; struct X0 { }; @@ -26,7 +26,7 @@ } // expected-error {{expected ';' after class}} WebVector(const WebVector& other) { } // expected-error{{undeclared identifier 'T'}} \ - expected-error{{requires a type specifier}} + expected-error{{a type specifier is required}} template WebVector& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}} Index: clang/test/CodeGen/2002-07-14-MiscTests2.c =================================================================== --- clang/test/CodeGen/2002-07-14-MiscTests2.c +++ 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) Index: clang/test/CodeGen/2003-08-20-vfork-bug.c =================================================================== --- clang/test/CodeGen/2003-08-20-vfork-bug.c +++ 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(); } Index: clang/test/CodeGen/2007-04-24-bit-not-expr.c =================================================================== --- clang/test/CodeGen/2007-04-24-bit-not-expr.c +++ 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))); Index: clang/test/CodeGen/2007-09-26-Alignment.c =================================================================== --- clang/test/CodeGen/2007-09-26-Alignment.c +++ 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))); Index: clang/test/CodeGen/2010-07-14-ref-off-end.c =================================================================== --- clang/test/CodeGen/2010-07-14-ref-off-end.c +++ clang/test/CodeGen/2010-07-14-ref-off-end.c @@ -6,13 +6,13 @@ 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 Index: clang/test/CodeGen/mips-clobber-reg.c =================================================================== --- clang/test/CodeGen/mips-clobber-reg.c +++ 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"); Index: clang/test/CodeGen/mips-vector-arg.c =================================================================== --- clang/test/CodeGen/mips-vector-arg.c +++ clang/test/CodeGen/mips-vector-arg.c @@ -9,19 +9,19 @@ 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); } Index: clang/test/Driver/cxx_for_opencl.clcpp =================================================================== --- clang/test/Driver/cxx_for_opencl.clcpp +++ clang/test/Driver/cxx_for_opencl.clcpp @@ -13,6 +13,6 @@ auto a = get_local_id(1); #ifndef __OPENCL_CPP_VERSION__ //expected-error@-2{{OpenCL C version 2.0 does not support the 'auto' storage class specifier}} -//expected-warning@-3{{type specifier missing, defaults to 'int'}} +//expected-error@-3{{type specifier missing, defaults to 'int'}} #endif } Index: clang/test/FixIt/fixit.c =================================================================== --- clang/test/FixIt/fixit.c +++ clang/test/FixIt/fixit.c @@ -29,7 +29,7 @@ // 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 @@ const typedef typedef int int_t; // expected-warning {{duplicate 'typedef'}} // -enum Color { +enum Color { Red // expected-error{{missing ',' between enumerators}} Green = 17 // expected-error{{missing ',' between enumerators}} Blue, Index: clang/test/Frontend/fixed_point_errors.c =================================================================== --- clang/test/Frontend/fixed_point_errors.c +++ clang/test/Frontend/fixed_point_errors.c @@ -228,9 +228,9 @@ // Using auto auto auto_fract = 0r; // expected-error{{invalid suffix 'r' on integer constant}} - // expected-warning@-1{{type specifier missing, defaults to 'int'}} + // expected-error@-1{{type specifier missing, defaults to 'int'}} auto auto_accum = 0k; // expected-error{{invalid suffix 'k' on integer constant}} - // expected-warning@-1{{type specifier missing, defaults to 'int'}} + // expected-error@-1{{type specifier missing, defaults to 'int'}} } // Ok conversions Index: clang/test/Frontend/fixed_point_not_enabled.c =================================================================== --- clang/test/Frontend/fixed_point_not_enabled.c +++ clang/test/Frontend/fixed_point_not_enabled.c @@ -11,7 +11,7 @@ // 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@-1{{type specifier missing, defaults to 'int'}} + // expected-error@-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 Index: clang/test/Frontend/system-header-line-directive.c =================================================================== --- clang/test/Frontend/system-header-line-directive.c +++ clang/test/Frontend/system-header-line-directive.c @@ -3,7 +3,7 @@ #include #include -// expected-warning@line-directive.h:* {{type specifier missing, defaults to 'int'}} +// expected-error@line-directive.h:* {{type specifier missing, defaults to 'int'}} #include "line-directive.h" // This tests that "#line" directives in system headers preserve system Index: clang/test/Index/reparsed-live-issue.cpp =================================================================== --- clang/test/Index/reparsed-live-issue.cpp +++ 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 Index: clang/test/Misc/warning-flags.c =================================================================== --- clang/test/Misc/warning-flags.c +++ clang/test/Misc/warning-flags.c @@ -18,11 +18,10 @@ 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 @@ 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 Index: clang/test/Modules/malformed-overload.m =================================================================== --- clang/test/Modules/malformed-overload.m +++ 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; Index: clang/test/Modules/va_list.m =================================================================== --- clang/test/Modules/va_list.m +++ 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 Index: clang/test/PCH/decl-in-prototype.c =================================================================== --- clang/test/PCH/decl-in-prototype.c +++ 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; } Index: clang/test/Parser/altivec.c =================================================================== --- clang/test/Parser/altivec.c +++ clang/test/Parser/altivec.c @@ -97,8 +97,8 @@ // 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__ Index: clang/test/Parser/attributes.c =================================================================== --- clang/test/Parser/attributes.c +++ clang/test/Parser/attributes.c @@ -7,7 +7,7 @@ } -__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 @@ // 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 @@ 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}} Index: clang/test/Parser/backtrack-off-by-one.cpp =================================================================== --- clang/test/Parser/backtrack-off-by-one.cpp +++ clang/test/Parser/backtrack-off-by-one.cpp @@ -17,7 +17,7 @@ // expected-error@+8 {{expected ';' after top level declarator}} #endif #if __cplusplus <= 201402L -// expected-error@+5 {{C++ requires a type specifier for all declarations}} +// expected-error@+5 {{a type specifier is required for all declarations}} #else // expected-error@+3 {{expected unqualified-id}} #endif Index: clang/test/Parser/c2x-attributes.c =================================================================== --- clang/test/Parser/c2x-attributes.c +++ clang/test/Parser/c2x-attributes.c @@ -60,7 +60,8 @@ 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 @@ // 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 '('}} Index: clang/test/Parser/c2x-func-prototype.c =================================================================== --- clang/test/Parser/c2x-func-prototype.c +++ 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 '('}} Index: clang/test/Parser/colon-colon-parentheses.cpp =================================================================== --- clang/test/Parser/colon-colon-parentheses.cpp +++ clang/test/Parser/colon-colon-parentheses.cpp @@ -24,7 +24,7 @@ // The following tests used to be crash bugs. // PR21815 -// expected-error@+2{{C++ requires a type specifier for all declarations}} +// expected-error@+2{{a type specifier is required for all declarations}} // expected-error@+1{{expected unqualified-id}} a (::( )); Index: clang/test/Parser/cxx-altivec.cpp =================================================================== --- clang/test/Parser/cxx-altivec.cpp +++ clang/test/Parser/cxx-altivec.cpp @@ -112,7 +112,8 @@ #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 different 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'}} Index: clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp =================================================================== --- clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp +++ clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp @@ -6,4 +6,4 @@ // type-specifier-seq in conversion-type-id template 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 Index: clang/test/Parser/cxx-decl.cpp =================================================================== --- clang/test/Parser/cxx-decl.cpp +++ clang/test/Parser/cxx-decl.cpp @@ -30,7 +30,7 @@ void foo() { y: // label y::a s; - + int a = 4; a = a ? a : a+1; } @@ -39,7 +39,7 @@ template class someclass { - + int bar() { T *P; return 1 ? P->x : P->y; @@ -62,7 +62,7 @@ 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 @@ }; void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}} -} +} ; @@ -306,14 +306,14 @@ // 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@-2 {{expected ';' after top level declarator}} #else // expected-error@-4 {{expected expression}} // expected-note@-5 {{to match this}} #endif - + int test6b; #if __cplusplus >= 201103L // expected-error@+3 {{expected}} Index: clang/test/Parser/cxx-keyword-identifiers.cpp =================================================================== --- clang/test/Parser/cxx-keyword-identifiers.cpp +++ clang/test/Parser/cxx-keyword-identifiers.cpp @@ -26,6 +26,6 @@ }; } 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 '('}} }; Index: clang/test/Parser/cxx-template-decl.cpp =================================================================== --- clang/test/Parser/cxx-template-decl.cpp +++ 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 x0; // expected-warning {{exported templates are unsupported}} @@ -62,7 +62,7 @@ template class NTP1; template class NTP2; template class NTP3; -template class NTP4; +template class NTP4; template class NTP5; template class NTP6; template class NTP7; @@ -111,11 +111,11 @@ }; // Non-type template parameters in scope -template +template 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 @@ template void bar(typename T::x); } - + template void N::bar(typename T::x) { } } @@ -198,7 +198,7 @@ struct O { template static oneT Fun(U); - + }; }; template @@ -212,8 +212,8 @@ oneT L<0>::O::Fun(U) { return one; } -void Instantiate() { - sassert(sizeof(L<0>::O::Fun(0)) == sizeof(one)); +void Instantiate() { + sassert(sizeof(L<0>::O::Fun(0)) == sizeof(one)); sassert(sizeof(L<0>::O::Fun(0)) == sizeof(one)); } Index: clang/test/Parser/cxx-undeclared-identifier.cpp =================================================================== --- clang/test/Parser/cxx-undeclared-identifier.cpp +++ 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 Index: clang/test/Parser/cxx2b-lambdas.cpp =================================================================== --- clang/test/Parser/cxx2b-lambdas.cpp +++ clang/test/Parser/cxx2b-lambdas.cpp @@ -28,7 +28,7 @@ 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}} \ Index: clang/test/Parser/declarators.c =================================================================== --- clang/test/Parser/declarators.c +++ clang/test/Parser/declarators.c @@ -6,7 +6,7 @@ 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 @@ // 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"); Index: clang/test/Parser/explicit-bool.cpp =================================================================== --- clang/test/Parser/explicit-bool.cpp +++ clang/test/Parser/explicit-bool.cpp @@ -54,7 +54,7 @@ // 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}} }; Index: clang/test/Parser/ext-int.cpp =================================================================== --- clang/test/Parser/ext-int.cpp +++ clang/test/Parser/ext-int.cpp @@ -4,12 +4,12 @@ // expected-note@+4{{to match this '('}} // expected-error@+3{{expected unqualified-id}} // expected-error@+2{{extraneous closing brace}} -// expected-error@+1{{C++ requires a type specifier for all declarations}} +// expected-error@+1{{a type specifier is required for all declarations}} _BitInt(32} a; // expected-error@+2{{expected expression}} -// expected-error@+1{{C++ requires a type specifier for all declarations}} +// expected-error@+1{{a type specifier is required for all declarations}} _BitInt(32* ) b; // expected-error@+3{{expected '('}} // expected-error@+2{{expected unqualified-id}} -// expected-error@+1{{C++ requires a type specifier for all declarations}} +// expected-error@+1{{a type specifier is required for all declarations}} _BitInt{32} c; Index: clang/test/Parser/objc-forcollection-neg-2.m =================================================================== --- clang/test/Parser/objc-forcollection-neg-2.m +++ clang/test/Parser/objc-forcollection-neg-2.m @@ -24,7 +24,7 @@ @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) Index: clang/test/Parser/static_assert.c =================================================================== --- clang/test/Parser/static_assert.c +++ 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 is a Microsoft extension}} #endif Index: clang/test/Preprocessor/macro_paste_msextensions.c =================================================================== --- clang/test/Preprocessor/macro_paste_msextensions.c +++ clang/test/Preprocessor/macro_paste_msextensions.c @@ -32,7 +32,7 @@ // 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)) Index: clang/test/Sema/address_spaces.c =================================================================== --- clang/test/Sema/address_spaces.c +++ clang/test/Sema/address_spaces.c @@ -9,7 +9,7 @@ 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}} Index: clang/test/Sema/auto-type.c =================================================================== --- clang/test/Sema/auto-type.c +++ clang/test/Sema/auto-type.c @@ -37,7 +37,7 @@ // 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. Index: clang/test/Sema/block-args.c =================================================================== --- clang/test/Sema/block-args.c +++ clang/test/Sema/block-args.c @@ -37,7 +37,7 @@ // 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 Index: clang/test/Sema/block-literal.c =================================================================== --- clang/test/Sema/block-literal.c +++ clang/test/Sema/block-literal.c @@ -29,7 +29,7 @@ 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 @@ 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 @@ static const void_block_t myBlock = ^{ }; -static const void_block_t myBlock2 = ^ void(void) { }; +static const void_block_t myBlock2 = ^ void(void) { }; Index: clang/test/Sema/c89.c =================================================================== --- clang/test/Sema/c89.c +++ clang/test/Sema/c89.c @@ -39,20 +39,16 @@ 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; Index: clang/test/Sema/crash-invalid-builtin.c =================================================================== --- clang/test/Sema/crash-invalid-builtin.c +++ 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 ()'}} Index: clang/test/Sema/darwin-tls.c =================================================================== --- clang/test/Sema/darwin-tls.c +++ 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; Index: clang/test/Sema/function.c =================================================================== --- clang/test/Sema/function.c +++ clang/test/Sema/function.c @@ -18,7 +18,7 @@ // 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 @@ } // -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, Index: clang/test/Sema/implicit-int.c =================================================================== --- clang/test/Sema/implicit-int.c +++ 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 @@ #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'}} */ + }; Index: clang/test/Sema/invalid-decl.c =================================================================== --- clang/test/Sema/invalid-decl.c +++ clang/test/Sema/invalid-decl.c @@ -6,7 +6,7 @@ // 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(); Index: clang/test/Sema/invalid-struct-init.c =================================================================== --- clang/test/Sema/invalid-struct-init.c +++ 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_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 }; } Index: clang/test/Sema/redefinition.c =================================================================== --- clang/test/Sema/redefinition.c +++ clang/test/Sema/redefinition.c @@ -4,7 +4,7 @@ int f(int a) { return 0; } // expected-error {{redefinition of 'f'}} // -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; Index: clang/test/Sema/return.c =================================================================== --- clang/test/Sema/return.c +++ 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 @@ goto done; } return 1; - case 4: + case 4: while (0) { goto done; } return 1; case 5: @@ -190,7 +190,7 @@ // 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) { Index: clang/test/Sema/typo-correction.c =================================================================== --- clang/test/Sema/typo-correction.c +++ clang/test/Sema/typo-correction.c @@ -10,11 +10,11 @@ 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}} Index: clang/test/Sema/warn-strict-prototypes.c =================================================================== --- clang/test/Sema/warn-strict-prototypes.c +++ 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 @@ 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}} Index: clang/test/SemaCXX/MicrosoftSuper.cpp =================================================================== --- clang/test/SemaCXX/MicrosoftSuper.cpp +++ clang/test/SemaCXX/MicrosoftSuper.cpp @@ -7,7 +7,7 @@ void foo() { // expected-note@+4 {{replace parentheses with an initializer to declare a variable}} // expected-warning@+3 {{empty parentheses interpreted as a function declaration}} - // expected-error@+2 {{C++ requires a type specifier for all declarations}} + // expected-error@+2 {{a type specifier is required for all declarations}} // expected-error@+1 {{use of '__super' inside a lambda is unsupported}} auto lambda = []{ __super::foo(); }; } Index: clang/test/SemaCXX/PR9459.cpp =================================================================== --- clang/test/SemaCXX/PR9459.cpp +++ clang/test/SemaCXX/PR9459.cpp @@ -3,5 +3,5 @@ // Don't crash. templatestruct ae_same; // expected-note {{}} -templatestruct ts{}ap() // expected-error {{expected ';' after struct}} expected-error {{requires a type specifier}} +templatestruct ts{}ap() // expected-error {{expected ';' after struct}} expected-error {{a type specifier is required}} {ts::ap::&ae_same<>>::p(a); }; // expected-error {{use of undeclared identifier 'a'}} expected-error 5{{}} Index: clang/test/SemaCXX/PR9460.cpp =================================================================== --- clang/test/SemaCXX/PR9460.cpp +++ 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 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 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); } } Index: clang/test/SemaCXX/PR9461.cpp =================================================================== --- clang/test/SemaCXX/PR9461.cpp +++ 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(); // expected-error {{requires}} +_S_construct(); // expected-error {{a type specifier is required}} }; template Index: clang/test/SemaCXX/crashes.cpp =================================================================== --- clang/test/SemaCXX/crashes.cpp +++ clang/test/SemaCXX/crashes.cpp @@ -5,13 +5,13 @@ // template class allocator; template struct char_traits; -template, +template, typename _Alloc = allocator<_CharT> > class basic_string; template -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 @@ -181,8 +181,8 @@ template 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 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}} } Index: clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp =================================================================== --- clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp +++ clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp @@ -8,10 +8,10 @@ #define CONST constexpr #endif -template +template T pi = T(3.1415926535897932385); // expected-note 2{{declared here}} -template +template CONST T cpi = T(3.1415926535897932385); // expected-note {{template is declared here}} template extern CONST T vc; @@ -33,7 +33,7 @@ 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 T circular_area(T r) { return pi * r * r; @@ -79,13 +79,13 @@ template T v; // expected-note {{previous definition is here}} template int v; // expected-error {{redefinition of 'v'}} - + template extern int v1; // expected-note {{previous template declaration is here}} template int v1; // expected-error {{template parameter has a different kind in template redeclaration}} } namespace pvt_use { template 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 @@ template extern auto v4; // expected-error {{declaration of variable 'v4' with deduced type 'auto' requires an initializer}} } #endif - + } namespace explicit_instantiation { - template + template T pi0a = T(3.1415926535897932385); // expected-note {{variable template 'pi0a' declared here}} template float pi0a; // expected-error {{type 'float' of explicit instantiation of 'pi0a' does not match expected type 'int'}} - template + template T pi0b = T(3.1415926535897932385); // expected-note {{variable template 'pi0b' declared here}} template CONST int pi0b; // expected-error {{type 'const int' of explicit instantiation of 'pi0b' does not match expected type 'int'}} - template + template T pi0c = T(3.1415926535897932385); // expected-note {{variable template 'pi0c' declared here}} template int pi0c; // expected-error {{type 'int' of explicit instantiation of 'pi0c' does not match expected type 'const int'}} - template + template T pi0 = T(3.1415926535897932385); template int pi0; // expected-note {{previous explicit instantiation is here}} template int pi0; // expected-error {{duplicate explicit instantiation of 'pi0'}} - template + template CONST T pi1a = T(3.1415926535897932385); // expected-note {{variable template 'pi1a' declared here}} template int pi1a; // expected-error {{type 'int' of explicit instantiation of 'pi1a' does not match expected type 'const int'}} - template + template CONST T pi1b = T(3.1415926535897932385); // expected-note {{variable template 'pi1b' declared here}} template int pi1b; // expected-error {{type 'int' of explicit instantiation of 'pi1b' does not match expected type 'const const int'}} - template + template CONST T pi1 = T(3.1415926535897932385); template CONST int pi1; // expected-note {{previous explicit instantiation is here}} template CONST int pi1; // expected-error {{duplicate explicit instantiation of 'pi1'}} @@ -159,7 +159,7 @@ namespace auto_var { template auto var0 = T(); template auto var0; // expected-error {{'auto' variable template instantiation is not allowed}} - + template auto var = T(); template int var; } @@ -187,7 +187,7 @@ template<> CONST int pi2 = 4; -#ifndef PRECXX11 +#ifndef PRECXX11 void foo() { static_assert(pi2 == 4, ""); static_assert(pi2 == 2, ""); @@ -209,15 +209,15 @@ template CONST int pi2 = 3; // expected-note {{partial specialization matches [with T = int]}} - + void foo() { int a = pi2; // expected-error {{ambiguous partial specializations of 'pi2'}} } } - + namespace type_changes { - template + template T pi0 = T(3.1415926535897932385); template<> float pi0 = 10; @@ -252,15 +252,15 @@ #endif - template + template CONST T pi1 = T(3.1415926535897932385); template<> CONST int pi1 = 10; // expected-note {{previous definition is here}} template<> CONST int pi1 = 10; // expected-error {{redefinition of 'pi1'}} } - + namespace before_instantiation { - template + template T pi0 = T(3.1415926535897932385); // expected-note {{variable template 'pi0' declared here}} template<> int pi0 = 10; // expected-note 2{{previous template specialization is here}} @@ -274,7 +274,7 @@ template CONST int pi2; } namespace after_instantiation { - template + template T pi0 = T(3.1415926535897932385); template int pi0; // expected-note 2{{explicit instantiation first required here}} @@ -304,11 +304,11 @@ } } #endif - + namespace extern_var { // TODO: } - + namespace diff_type { // TODO: template T* var = new T(); @@ -343,7 +343,7 @@ float f = 10.5; template<> float* arr = &f; - + void bar() { int *iarr = arr; iarr[0] = 1; @@ -357,48 +357,48 @@ #endif namespace nested { - + namespace n0a { - template + template T pi0a = T(3.1415926535897932385); } - + using namespace n0a; int i0a = pi0a; - + template float pi0a; float f0a = pi0a; - + template<> double pi0a = 5.2; double d0a = pi0a; namespace n0b { - template + template T pi0b = T(3.1415926535897932385); } - + int i0b = n0b::pi0b; - + template float n0b::pi0b; float f0b = n0b::pi0b; - + template<> double n0b::pi0b = 5.2; double d0b = n0b::pi0b; - + namespace n1 { - template + template T pi1a = T(3.1415926535897932385); // expected-note {{explicitly specialized declaration is here}} #ifndef PRECXX11 // expected-note@-2 {{explicit instantiation refers here}} #endif - template + template T pi1b = T(3.1415926535897932385); // expected-note {{explicitly specialized declaration is here}} #ifndef PRECXX11 // expected-note@-2 {{explicit instantiation refers here}} #endif } - + namespace use_n1a { using namespace n1; int i1 = pi1a; @@ -408,20 +408,20 @@ // expected-error@-2 {{explicit instantiation of 'pi1a' not in a namespace enclosing 'n1'}} #endif float f1 = pi1a; - + template<> double pi1a = 5.2; // expected-error {{not in a namespace enclosing 'n1'}} double d1 = pi1a; } - + namespace use_n1b { int i1 = n1::pi1b; - + template float n1::pi1b; #ifndef PRECXX11 // expected-error@-2 {{explicit instantiation of 'pi1b' not in a namespace enclosing 'n1'}} #endif float f1 = n1::pi1b; - + template<> double n1::pi1b = 5.2; // expected-error {{not in a namespace enclosing 'n1'}} double d1 = n1::pi1b; } @@ -451,7 +451,7 @@ template int* f(); template void f(); template<> int f; // expected-error {{no variable template matches specialization; did you mean to use 'f' as function template instead?}} - + template void g(); template<> int g; // expected-error {{no variable template matches specialization; did you mean to use 'g' as function template instead?}} } Index: clang/test/SemaCXX/for-range-crash.cpp =================================================================== --- clang/test/SemaCXX/for-range-crash.cpp +++ clang/test/SemaCXX/for-range-crash.cpp @@ -8,7 +8,7 @@ template class Bar { Bar *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; } Index: clang/test/SemaCXX/implicit-int.cpp =================================================================== --- clang/test/SemaCXX/implicit-int.cpp +++ 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}} Index: clang/test/SemaCXX/lambda-invalid-capture.cpp =================================================================== --- clang/test/SemaCXX/lambda-invalid-capture.cpp +++ 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() { Index: clang/test/SemaCXX/pr18284-crash-on-invalid.cpp =================================================================== --- clang/test/SemaCXX/pr18284-crash-on-invalid.cpp +++ clang/test/SemaCXX/pr18284-crash-on-invalid.cpp @@ -5,7 +5,7 @@ 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 @@ 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; Index: clang/test/SemaCXX/typo-correction-delayed.cpp =================================================================== --- clang/test/SemaCXX/typo-correction-delayed.cpp +++ clang/test/SemaCXX/typo-correction-delayed.cpp @@ -159,7 +159,7 @@ } 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'{{$}}}} } Index: clang/test/SemaCXX/typo-correction.cpp =================================================================== --- clang/test/SemaCXX/typo-correction.cpp +++ clang/test/SemaCXX/typo-correction.cpp @@ -494,7 +494,7 @@ // instead of incorrectly suggesting dropping "PR18213::WrapperInfo::". template <> PR18213::WrapperInfo ::PR18213::Wrappable::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 { Index: clang/test/SemaCXX/unknown-type-name.cpp =================================================================== --- clang/test/SemaCXX/unknown-type-name.cpp +++ clang/test/SemaCXX/unknown-type-name.cpp @@ -116,4 +116,4 @@ // FIXME: We know which type specifier should have been specified here. Provide // a fix-it to add 'typename A::type' template -A::g() { } // expected-error{{requires a type specifier}} +A::g() { } // expected-error{{a type specifier is required}} Index: clang/test/SemaObjC/protocols.m =================================================================== --- clang/test/SemaObjC/protocols.m +++ clang/test/SemaObjC/protocols.m @@ -62,6 +62,6 @@ @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 Index: clang/test/SemaObjCXX/crash.mm =================================================================== --- clang/test/SemaObjCXX/crash.mm +++ clang/test/SemaObjCXX/crash.mm @@ -42,21 +42,21 @@ // expected-error@-1 {{type name requires a specifier or qualifier}} // expected-error@-2 {{property requires fields to be named}} // expected-error@-3 {{expected ';' at end of declaration list}} -// expected-error@-4 {{C++ requires a type specifier for all declarations}} +// expected-error@-4 {{a type specifier is required for all declarations}} // expected-error@-5 {{cannot declare variable inside @interface or @protocol}} @property (nonatomic) (ns::InnerType) invalidTypeParens2; // expected-error@-1 {{type name requires a specifier or qualifier}} // expected-error@-2 {{property requires fields to be named}} // expected-error@-3 {{expected ';' at end of declaration list}} -// expected-error@-4 {{C++ requires a type specifier for all declarations}} +// expected-error@-4 {{a type specifier is required for all declarations}} // expected-error@-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@-1 {{expected ';' at end of declaration list}} -// expected-error@-2 {{C++ requires a type specifier for all declarations}} +// expected-error@-2 {{a type specifier is required for all declarations}} // expected-error@-3 {{cannot declare variable inside @interface or @protocol}} @end Index: clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl =================================================================== --- clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl +++ clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl @@ -10,7 +10,7 @@ // expected-error@-5 {{C++ for OpenCL version 2021 does not support the 'pipe' type qualifier}} // expected-error@-6 {{access qualifier can only be used for pipe and image type}} #else -// expected-warning@-8 {{type specifier missing, defaults to 'int'}} +// expected-error@-8 {{type specifier missing, defaults to 'int'}} // expected-error@-9 {{access qualifier can only be used for pipe and image type}} // expected-error@-10 {{expected ')'}} expected-note@-10 {{to match this '('}} #endif Index: clang/test/SemaTemplate/address_space-dependent.cpp =================================================================== --- clang/test/SemaTemplate/address_space-dependent.cpp +++ clang/test/SemaTemplate/address_space-dependent.cpp @@ -9,7 +9,7 @@ __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 @@ void test_different_template() { (void) different_template<0>(); } // expected-error {{call to 'different_template' is ambiguous}} template struct partial_spec_deduce_as; -template +template 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 @@ 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::value == 3, "address space value has been incorrectly deduced"); + + static_assert(partial_spec_deduce_as::value == 3, "address space value has been incorrectly deduced"); return 0; } Index: clang/test/SemaTemplate/derived.cpp =================================================================== --- clang/test/SemaTemplate/derived.cpp +++ clang/test/SemaTemplate/derived.cpp @@ -14,7 +14,7 @@ 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 > {}; Index: clang/test/SemaTemplate/temp_arg_template.cpp =================================================================== --- clang/test/SemaTemplate/temp_arg_template.cpp +++ clang/test/SemaTemplate/temp_arg_template.cpp @@ -19,7 +19,7 @@ template struct TooMany; // expected-note{{too many template parameters in template template argument}} -A *a1; +A *a1; A *a2; A< ::N::Z> *a3; @@ -42,19 +42,19 @@ // 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 + template struct X { }; - template + template struct Y { X const_ref(); }; - template class TT, typename T, int N> + template class TT, typename T, int N> int operator<<(int, TT a) { // expected-note{{candidate template ignored}} 0 << a.const_ref(); // expected-error{{invalid operands to binary expression ('int' and 'X')}} } Index: clang/test/Tooling/auto-detect-from-source-parent.cpp =================================================================== --- clang/test/Tooling/auto-detect-from-source-parent.cpp +++ 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; Index: clang/test/Tooling/clang-check-args.cpp =================================================================== --- clang/test/Tooling/clang-check-args.cpp +++ 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; Index: clang/test/Tooling/clang-check-autodetect-dir.cpp =================================================================== --- clang/test/Tooling/clang-check-autodetect-dir.cpp +++ 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; Index: clang/test/Tooling/clang-check-builtin-headers.cpp =================================================================== --- clang/test/Tooling/clang-check-builtin-headers.cpp +++ clang/test/Tooling/clang-check-builtin-headers.cpp @@ -8,5 +8,5 @@ #include -// CHECK: C++ requires +// CHECK: a type specifier is required invalid; Index: clang/test/Tooling/clang-check-chdir.cpp =================================================================== --- clang/test/Tooling/clang-check-chdir.cpp +++ 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; Index: clang/test/Tooling/clang-check-rel-path.cpp =================================================================== --- clang/test/Tooling/clang-check-rel-path.cpp +++ 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; Index: clang/test/Tooling/clang-check-strip-o.cpp =================================================================== --- clang/test/Tooling/clang-check-strip-o.cpp +++ 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; Index: clang/test/Tooling/clang-check.cpp =================================================================== --- clang/test/Tooling/clang-check.cpp +++ 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; Index: clang/test/Tooling/multi-jobs.cpp =================================================================== --- clang/test/Tooling/multi-jobs.cpp +++ 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;