Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -37,6 +37,22 @@ infrastructure are described first, followed by language-specific sections with improvements to Clang's support for those languages. +Potentially Breaking Changes +============================ +These changes are ones which we think may surprise users when upgrading to +Clang |release| because of the opportunity they pose for disruption to existing +code bases. + +- The ``-Wimplicit-function-declaration`` and ``-Wimplicit-int`` warning + diagnostics are now enabled by default in C99, C11, and C17. As of C2x, + support for implicit function declarations and 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. + *NOTE* these warnings are expected to default to an error in Clang 16. We + recommend that projects using configure scripts verify the results do not + change before/after setting ``-Werror=implicit-function-declarations`` or + ``-Wimplicit-int`` to avoid incompatibility with Clang 16. + Major New Features ------------------ @@ -245,18 +261,6 @@ without a prototype and with no arguments is an invalid redeclaration of a function with a prototype. e.g., ``void f(int); void f() {}`` is now properly diagnosed. -- The ``-Wimplicit-function-declaration`` 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-function-declaration``, or disabled entirely with - ``-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 Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -419,7 +419,7 @@ InGroup, DefaultIgnore; def ext_implicit_function_decl_c99 : ExtWarn< "call to undeclared function %0; ISO C99 and later do not support implicit " - "function declarations">, InGroup, DefaultError; + "function declarations">, InGroup; def note_function_suggestion : Note<"did you mean %0?">; def err_ellipsis_first_param : Error< @@ -705,7 +705,7 @@ def ext_implicit_lib_function_decl_c99 : ExtWarn< "call to undeclared library function '%0' with type %1; ISO C99 and later " "do not support implicit function declarations">, - InGroup, DefaultError; + InGroup; def note_include_header_or_declare : Note< "include the header <%0> or explicitly provide a declaration for '%1'">; def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">; @@ -4359,7 +4359,7 @@ "a parameter list without types is only allowed in a function definition">; 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; + "support implicit int">, InGroup; def err_param_default_argument : Error< "C does not support default arguments">; def err_param_default_argument_redefinition : Error< @@ -10029,7 +10029,7 @@ def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; def ext_missing_type_specifier : ExtWarn< "type specifier missing, defaults to 'int'; ISO C99 and later do not support " - "implicit int">, InGroup, DefaultError; + "implicit int">, InGroup; def err_missing_type_specifier : Error< "a type specifier is required for all declarations">; def err_decimal_unsupported : Error< Index: clang/test/C/drs/dr0xx.c =================================================================== --- clang/test/C/drs/dr0xx.c +++ clang/test/C/drs/dr0xx.c @@ -110,7 +110,7 @@ * of treated as declaring a parameter of type 'int (*)(dr009_t);' */ typedef int dr009_t; -void dr009_f((dr009_t)); /* c99untilc2x-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} +void dr009_f((dr009_t)); /* c99untilc2x-warning {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} c2xandup-error {{a type specifier is required for all declarations}} */ /* WG14 DR010: Index: clang/test/C/drs/dr1xx.c =================================================================== --- clang/test/C/drs/dr1xx.c +++ clang/test/C/drs/dr1xx.c @@ -369,7 +369,7 @@ int i; i = undeclared; /* expected-error {{use of undeclared identifier 'undeclared'}} */ sdfsdfsf = 1; /* expected-error {{use of undeclared identifier 'sdfsdfsf'}} */ - i = also_undeclared(); /* c99untilc2x-error {{call to undeclared function 'also_undeclared'; ISO C99 and later do not support implicit function declarations}} + i = also_undeclared(); /* c99untilc2x-warning {{call to undeclared function 'also_undeclared'; ISO C99 and later do not support implicit function declarations}} c2xandup-error {{use of undeclared identifier 'also_undeclared'}} */ } Index: clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c =================================================================== --- clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c +++ clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c @@ -143,7 +143,7 @@ res_vui = vec_mergee(vui, vui); // CHECK: @llvm.ppc.altivec.vperm // CHECK-LE: @llvm.ppc.altivec.vperm -// CHECK-PPC: error: call to undeclared function 'vec_mergee' +// CHECK-PPC: warning: call to undeclared function 'vec_mergee' res_vbll = vec_mergee(vbll, vbll); // CHECK: @llvm.ppc.altivec.vperm @@ -177,7 +177,7 @@ res_vui = vec_mergeo(vui, vui); // CHECK: @llvm.ppc.altivec.vperm // CHECK-LE: @llvm.ppc.altivec.vperm -// CHECK-PPC: error: call to undeclared function 'vec_mergeo' +// CHECK-PPC: warning: call to undeclared function 'vec_mergeo' /* vec_cmpeq */ res_vbll = vec_cmpeq(vbll, vbll); @@ -403,7 +403,7 @@ res_vsc = vec_cntlz(vsc); // CHECK: call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %{{.+}}, i1 false) // CHECK-LE: call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %{{.+}}, i1 false) -// CHECK-PPC: error: call to undeclared function 'vec_cntlz' +// CHECK-PPC: warning: call to undeclared function 'vec_cntlz' res_vuc = vec_cntlz(vuc); // CHECK: call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %{{.+}}, i1 false) @@ -754,19 +754,19 @@ res_vsi = vec_vpksdss(vsll, vsll); // CHECK: llvm.ppc.altivec.vpksdss // CHECK-LE: llvm.ppc.altivec.vpksdss -// CHECK-PPC: error: call to undeclared function 'vec_vpksdss' +// CHECK-PPC: warning: call to undeclared function 'vec_vpksdss' /* vec_vpksdus */ res_vui = vec_vpksdus(vsll, vsll); // CHECK: llvm.ppc.altivec.vpksdus // CHECK-LE: llvm.ppc.altivec.vpksdus -// CHECK-PPC: error: call to undeclared function 'vec_vpksdus' +// CHECK-PPC: warning: call to undeclared function 'vec_vpksdus' /* vec_vpkudum */ res_vsi = vec_vpkudum(vsll, vsll); // CHECK: vperm // CHECK-LE: vperm -// CHECK-PPC: error: call to undeclared function 'vec_vpkudum' +// CHECK-PPC: warning: call to undeclared function 'vec_vpkudum' res_vui = vec_vpkudum(vull, vull); // CHECK: vperm @@ -775,13 +775,13 @@ res_vui = vec_vpkudus(vull, vull); // CHECK: llvm.ppc.altivec.vpkudus // CHECK-LE: llvm.ppc.altivec.vpkudus -// CHECK-PPC: error: call to undeclared function 'vec_vpkudus' +// CHECK-PPC: warning: call to undeclared function 'vec_vpkudus' /* vec_vupkhsw */ res_vsll = vec_vupkhsw(vsi); // CHECK: llvm.ppc.altivec.vupkhsw // CHECK-LE: llvm.ppc.altivec.vupklsw -// CHECK-PPC: error: call to undeclared function 'vec_vupkhsw' +// CHECK-PPC: warning: call to undeclared function 'vec_vupkhsw' res_vbll = vec_vupkhsw(vbi); // CHECK: llvm.ppc.altivec.vupkhsw @@ -791,7 +791,7 @@ res_vsll = vec_vupklsw(vsi); // CHECK: llvm.ppc.altivec.vupklsw // CHECK-LE: llvm.ppc.altivec.vupkhsw -// CHECK-PPC: error: call to undeclared function 'vec_vupklsw' +// CHECK-PPC: warning: call to undeclared function 'vec_vupklsw' res_vbll = vec_vupklsw(vbi); // CHECK: llvm.ppc.altivec.vupklsw @@ -845,7 +845,7 @@ // CHECK: xor <16 x i8> [[T1]], // CHECK-LE: [[T1:%.+]] = and <16 x i8> // CHECK-LE: xor <16 x i8> [[T1]], -// CHECK-PPC: error: call to undeclared function 'vec_nand' +// CHECK-PPC: warning: call to undeclared function 'vec_nand' res_vbc = vec_nand(vbc, vbc); // CHECK: [[T1:%.+]] = and <16 x i8> @@ -937,7 +937,7 @@ // CHECK: or <16 x i8> {{%.+}}, [[T1]] // CHECK-LE: [[T1:%.+]] = xor <16 x i8> {{%.+}}, // CHECK-LE: or <16 x i8> {{%.+}}, [[T1]] -// CHECK-PPC: error: call to undeclared function 'vec_orc' +// CHECK-PPC: warning: call to undeclared function 'vec_orc' res_vsc = vec_orc(vsc, vbc); // CHECK: [[T1:%.+]] = xor <16 x i8> {{%.+}}, @@ -1166,7 +1166,7 @@ res_vsll = vec_vbpermq(vuc, vuc); // CHECK: llvm.ppc.altivec.vbpermq // CHECK-LE: llvm.ppc.altivec.vbpermq -// CHECK-PPC: error: call to undeclared function 'vec_vbpermq' +// CHECK-PPC: warning: call to undeclared function 'vec_vbpermq' /* vec_vgbbd */ res_vsc = vec_vgbbd(vsc); @@ -1176,12 +1176,12 @@ res_vuc = vec_vgbbd(vuc); // CHECK: llvm.ppc.altivec.vgbbd // CHECK-LE: llvm.ppc.altivec.vgbbd -// CHECK-PPC: error: call to undeclared function 'vec_vgbbd' +// CHECK-PPC: warning: call to undeclared function 'vec_vgbbd' res_vuc = vec_gb(vuc); // CHECK: llvm.ppc.altivec.vgbbd // CHECK-LE: llvm.ppc.altivec.vgbbd -// CHECK-PPC: error: call to undeclared function 'vec_gb' +// CHECK-PPC: warning: call to undeclared function 'vec_gb' res_vsll = vec_gbb(vsll); // CHECK: llvm.ppc.altivec.vgbbd Index: clang/test/CodeGen/builtins-arm-msvc-compat-only.c =================================================================== --- clang/test/CodeGen/builtins-arm-msvc-compat-only.c +++ clang/test/CodeGen/builtins-arm-msvc-compat-only.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple thumbv7-windows -fms-extensions -emit-llvm -o - %s \ // RUN: | FileCheck %s -check-prefix CHECK-MSVC -// RUN: not %clang_cc1 -triple armv7-eabi -emit-llvm %s -o /dev/null 2>&1 \ +// RUN: %clang_cc1 -triple armv7-eabi -emit-llvm %s -o /dev/null 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EABI // REQUIRES: arm-registered-target @@ -9,7 +9,7 @@ } // CHECK-MSVC: call void asm sideeffect ".inst.n 0xDEFE", ""() -// CHECK-EABI: error: call to undeclared function '__emit' +// CHECK-EABI: warning: call to undeclared function '__emit' void emit_truncated() { __emit(0x11110000); // movs r0, r0 Index: clang/test/CodeGen/neon-crypto.c =================================================================== --- clang/test/CodeGen/neon-crypto.c +++ clang/test/CodeGen/neon-crypto.c @@ -14,7 +14,7 @@ uint8x16_t test_vaeseq_u8(uint8x16_t data, uint8x16_t key) { // CHECK-LABEL: @test_vaeseq_u8 - // CHECK-NO-CRYPTO: error: call to undeclared function 'vaeseq_u8' + // CHECK-NO-CRYPTO: warning: call to undeclared function 'vaeseq_u8' return vaeseq_u8(data, key); // CHECK: call <16 x i8> @llvm.{{arm.neon|aarch64.crypto}}.aese(<16 x i8> %data, <16 x i8> %key) } 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-error@-3{{type specifier missing, defaults to 'int'}} +//expected-warning@-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-error 2{{was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} +void f1(x, y) // expected-warning 2{{was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} { } 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-error@-1{{type specifier missing, defaults to 'int'}} + // expected-warning@-1{{type specifier missing, defaults to 'int'}} auto auto_accum = 0k; // expected-error{{invalid suffix 'k' on integer constant}} - // expected-error@-1{{type specifier missing, defaults to 'int'}} + // expected-warning@-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-error@-1{{type specifier missing, defaults to 'int'}} + // expected-warning@-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-error@line-directive.h:* {{type specifier missing, defaults to 'int'}} +// expected-warning@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/Headers/arm-cmse-header-ns.c =================================================================== --- clang/test/Headers/arm-cmse-header-ns.c +++ clang/test/Headers/arm-cmse-header-ns.c @@ -1,4 +1,4 @@ -// RUN: not %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-c %s +// RUN: %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-c %s // RUN: not %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only -x c++ %s 2>&1 | FileCheck --check-prefix=CHECK-cpp %s #include @@ -16,10 +16,10 @@ cmse_TTAT(p); cmse_TTA_fptr(fptr); cmse_TTAT_fptr(fptr); -// CHECK-c: error: call to undeclared function 'cmse_TTA' -// CHECK-c: error: call to undeclared function 'cmse_TTAT' -// CHECK-c: error: call to undeclared function 'cmse_TTA_fptr' -// CHECK-c: error: call to undeclared function 'cmse_TTAT_fptr' +// CHECK-c: warning: call to undeclared function 'cmse_TTA' +// CHECK-c: warning: call to undeclared function 'cmse_TTAT' +// CHECK-c: warning: call to undeclared function 'cmse_TTA_fptr' +// CHECK-c: warning: call to undeclared function 'cmse_TTAT_fptr' // CHECK-cpp: error: use of undeclared identifier 'cmse_TTA' // CHECK-cpp: error: use of undeclared identifier 'cmse_TTAT' // CHECK-cpp: error: use of undeclared identifier 'cmse_TTA_fptr' Index: clang/test/Modules/config_macros.m =================================================================== --- clang/test/Modules/config_macros.m +++ clang/test/Modules/config_macros.m @@ -5,7 +5,7 @@ } char *test_bar(void) { - return bar(); // expected-error{{call to undeclared function 'bar'; ISO C99 and later do not support implicit function declarations}} \ + return bar(); // expected-warning{{call to undeclared function 'bar'; ISO C99 and later do not support implicit function declarations}} \ // expected-error{{incompatible integer to pointer conversion}} } 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-error {{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-warning {{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/modulemap-locations.m =================================================================== --- clang/test/Modules/modulemap-locations.m +++ clang/test/Modules/modulemap-locations.m @@ -12,9 +12,7 @@ void test(void) { will_be_found1(); - wont_be_found1(); // expected-error{{call to undeclared function 'wont_be_found1'; ISO C99 and later do not support implicit function declarations}} \ - expected-note {{did you mean 'will_be_found1'?}} \ - expected-note@Inputs/ModuleMapLocations/Module_ModuleMap/a.h:1 {{'will_be_found1' declared here}} + wont_be_found1(); // expected-warning{{call to undeclared function 'wont_be_found1'; ISO C99 and later do not support implicit function declarations}} will_be_found2(); - wont_be_found2(); // expected-error{{call to undeclared function 'wont_be_found2'; ISO C99 and later do not support implicit function declarations}} + wont_be_found2(); // expected-warning{{call to undeclared function 'wont_be_found2'; ISO C99 and later do not support implicit function declarations}} } Index: clang/test/OpenMP/declare_mapper_messages.c =================================================================== --- clang/test/OpenMP/declare_mapper_messages.c +++ clang/test/OpenMP/declare_mapper_messages.c @@ -42,9 +42,9 @@ {} #pragma omp target map(mapper:vv) // expected-error {{expected '(' after 'mapper'}} {} -#pragma omp target map(mapper( :vv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-error {{call to undeclared function 'mapper'}} expected-note {{to match this '('}} +#pragma omp target map(mapper( :vv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-warning {{call to undeclared function 'mapper'}} expected-note {{to match this '('}} {} -#pragma omp target map(mapper(aa :vv) // expected-error {{use of undeclared identifier 'aa'}} expected-error {{expected ')'}} expected-error {{call to undeclared function 'mapper'}} expected-note {{to match this '('}} +#pragma omp target map(mapper(aa :vv) // expected-error {{use of undeclared identifier 'aa'}} expected-error {{expected ')'}} expected-warning {{call to undeclared function 'mapper'}} expected-note {{to match this '('}} {} #pragma omp target map(mapper(ab) :vv) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} {} Index: clang/test/PCH/chain-macro-override.c =================================================================== --- clang/test/PCH/chain-macro-override.c +++ clang/test/PCH/chain-macro-override.c @@ -10,7 +10,7 @@ f(); g(); h(); - h2(); // expected-error {{call to undeclared function 'h2'; ISO C99 and later do not support implicit function declarations}} + h2(); // expected-warning {{call to undeclared function 'h2'; ISO C99 and later do not support implicit function declarations}} h3(); return x; } 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-error {{type specifier missing, defaults to 'int'}} -vector __bool v___b; // expected-error {{type specifier missing, defaults to 'int'}} +vector bool v_b; // expected-warning {{type specifier missing, defaults to 'int'}} +vector __bool v___b; // expected-warning {{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-error {{type specifier missing, defaults to 'int'}} +__attribute__(()) y; // expected-warning {{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-error {{type specifier missing, defaults to 'int'}} - y); // expected-error {{type specifier missing, defaults to 'int'}} +void f3(__attribute__(()) x, // expected-warning {{type specifier missing, defaults to 'int'}} + y); // expected-warning {{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-error {{type specifier missing, defaults to 'int'}} +void g3(void (*f3)(__attribute__(()) x, int y)); // expected-warning {{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-error {{type specifier missing, defaults to 'int'}} +void (*h3)(void (*f3)(__attribute__(()) x)); // expected-warning {{type specifier missing, defaults to 'int'}} void (*h4)(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}} 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-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} */ +int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{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-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}} +static f; // expected-warning {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} +static g = 4; // expected-warning {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} +static h // expected-warning {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} __asm__("foo"); 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-error {{type specifier missing, defaults to 'int'}} + static i;// expected-warning {{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/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-error {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}} +bar(q) // expected-warning {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}} // CHECK: abc(baz(q)) Index: clang/test/Sema/__try.c =================================================================== --- clang/test/Sema/__try.c +++ clang/test/Sema/__try.c @@ -50,7 +50,7 @@ } // expected-error{{expected '__except' or '__finally' block}} void TEST(void) { - __except (FilterExpression()) { // expected-error{{call to undeclared function '__except'; ISO C99 and later do not support implicit function declarations}} \ + __except (FilterExpression()) { // expected-warning{{call to undeclared function '__except'; ISO C99 and later do not support implicit function declarations}} \ // expected-error{{too few arguments to function call, expected 1, have 0}} \ // expected-error{{expected ';' after expression}} } Index: clang/test/Sema/aarch64-tme-errors.c =================================================================== --- clang/test/Sema/aarch64-tme-errors.c +++ clang/test/Sema/aarch64-tme-errors.c @@ -3,6 +3,6 @@ #include "arm_acle.h" void test_no_tme_funcs(void) { - __tstart(); // expected-error{{call to undeclared function '__tstart'; ISO C99 and later do not support implicit function declarations}} + __tstart(); // expected-warning{{call to undeclared function '__tstart'; ISO C99 and later do not support implicit function declarations}} __builtin_tstart(); // expected-error{{use of unknown builtin '__builtin_tstart'}} } 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-error {{type specifier missing, defaults to 'int'}} + _AS2 *x;// expected-warning {{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-error {{type specifier missing, defaults to 'int'}} + // expected-warning {{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/bitfield.c =================================================================== --- clang/test/Sema/bitfield.c +++ clang/test/Sema/bitfield.c @@ -84,5 +84,5 @@ }; struct PR36157 { - int n : 1 ? 1 : implicitly_declare_function(); // expected-error {{call to undeclared function 'implicitly_declare_function'; ISO C99 and later do not support implicit function declarations}} + int n : 1 ? 1 : implicitly_declare_function(); // expected-warning {{call to undeclared function 'implicitly_declare_function'; ISO C99 and later do not support implicit function declarations}} }; 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-error {{type specifier missing}} expected-error {{type-id cannot have a name}} + int (^f)(void) = ^((x)) { }; // expected-warning {{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 @@ -41,7 +41,7 @@ foo: takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}} - __block y = 7; // expected-error {{type specifier missing, defaults to 'int'}} + __block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}} takeblock(^{ y = 8; }); } Index: clang/test/Sema/builtin-setjmp.c =================================================================== --- clang/test/Sema/builtin-setjmp.c +++ clang/test/Sema/builtin-setjmp.c @@ -35,10 +35,10 @@ setjmp(0); #if NO_SETJMP // cxx-error@-2 {{undeclared identifier 'setjmp'}} - // c-error@-3 {{call to undeclared function 'setjmp'; ISO C99 and later do not support implicit function declarations}} + // c-warning@-3 {{call to undeclared function 'setjmp'; ISO C99 and later do not support implicit function declarations}} #elif ONLY_JMP_BUF // cxx-error@-5 {{undeclared identifier 'setjmp'}} - // c-error@-6 {{call to undeclared library function 'setjmp' with type 'int (jmp_buf)' (aka 'int (int *)'); ISO C99 and later do not support implicit function declarations}} + // c-warning@-6 {{call to undeclared library function 'setjmp' with type 'int (jmp_buf)' (aka 'int (int *)'); ISO C99 and later do not support implicit function declarations}} // c-note@-7 {{include the header or explicitly provide a declaration for 'setjmp'}} #else // cxx-no-diagnostics Index: clang/test/Sema/builtins.c =================================================================== --- clang/test/Sema/builtins.c +++ clang/test/Sema/builtins.c @@ -206,9 +206,9 @@ } void no_ms_builtins(void) { - __assume(1); // expected-error {{call to undeclared function '__assume'; ISO C99 and later do not support implicit function declarations}} - __noop(1); // expected-error {{call to undeclared function '__noop'; ISO C99 and later do not support implicit function declarations}} - __debugbreak(); // expected-error {{call to undeclared function '__debugbreak'; ISO C99 and later do not support implicit function declarations}} + __assume(1); // expected-warning {{call to undeclared function '__assume'; ISO C99 and later do not support implicit function declarations}} + __noop(1); // expected-warning {{call to undeclared function '__noop'; ISO C99 and later do not support implicit function declarations}} + __debugbreak(); // expected-warning {{call to undeclared function '__debugbreak'; ISO C99 and later do not support implicit function declarations}} } void unavailable(void) { 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-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 ()'}} +__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 ()'}} Index: clang/test/Sema/cxx-as-c.c =================================================================== --- clang/test/Sema/cxx-as-c.c +++ clang/test/Sema/cxx-as-c.c @@ -2,7 +2,7 @@ // PR36157 struct Foo { - Foo(int n) : n_(n) {} // expected-error 1+{{}} + Foo(int n) : n_(n) {} // expected-error 1+{{}} expected-warning 1+{{}} private: int n; }; 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-error {{type specifier missing, defaults to 'int'}} +int t6(int x, g); // expected-warning {{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-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'}} +y(y) { return y; } // expected-warning{{parameter 'y' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \ + // expected-warning{{type specifier missing, defaults to 'int'}} // PR3137, Index: clang/test/Sema/implicit-builtin-decl.c =================================================================== --- clang/test/Sema/implicit-builtin-decl.c +++ clang/test/Sema/implicit-builtin-decl.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s void f() { - int *ptr = malloc(sizeof(int) * 10); // expected-error{{call to undeclared library function 'malloc' with type}} \ + int *ptr = malloc(sizeof(int) * 10); // expected-warning{{call to undeclared library function 'malloc' with type}} \ // expected-note{{include the header or explicitly provide a declaration for 'malloc'}} \ // expected-note{{'malloc' is a builtin with type 'void *}} } @@ -24,7 +24,7 @@ void f2() { fprintf(0, "foo"); // expected-warning{{declaration of built-in function 'fprintf' requires inclusion of the header }} \ - expected-error {{call to undeclared function 'fprintf'; ISO C99 and later do not support implicit function declarations}} + expected-warning {{call to undeclared function 'fprintf'; ISO C99 and later do not support implicit function declarations}} } // PR2892 Index: clang/test/Sema/implicit-decl.c =================================================================== --- clang/test/Sema/implicit-decl.c +++ clang/test/Sema/implicit-decl.c @@ -1,55 +1,60 @@ -// RUN: %clang_cc1 %s -verify -fsyntax-only -Werror=implicit-function-declaration -std=c99 -// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c11 +// RUN: %clang_cc1 %s -verify=werror,both -fsyntax-only -Werror=implicit-function-declaration -std=c99 +// RUN: %clang_cc1 %s -verify=expected,both -fsyntax-only -std=c11 // RUN: %clang_cc1 %s -verify=c2x -fsyntax-only -std=c2x /// -Werror-implicit-function-declaration is a deprecated alias used by many projects. -// RUN: %clang_cc1 %s -verify -fsyntax-only -Werror-implicit-function-declaration +// RUN: %clang_cc1 %s -verify=werror,both -fsyntax-only -Werror-implicit-function-declaration // c2x-note@*:* {{'__builtin_va_list' declared here}} typedef int int32_t; typedef unsigned char Boolean; -extern int printf(__const char *__restrict __format, ...); // expected-note{{'printf' declared here}} \ +extern int printf(__const char *__restrict __format, ...); // werror-note{{'printf' declared here}} \ c2x-note {{'printf' declared here}} void func(void) { int32_t *vector[16]; const char compDesc[16 + 1]; int32_t compCount = 0; - if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error {{call to undeclared function '_CFCalendarDecomposeAbsoluteTimeV'; ISO C99 and later do not support implicit function declarations}} \ - expected-note {{previous implicit declaration}} \ + if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // werror-error {{call to undeclared function '_CFCalendarDecomposeAbsoluteTimeV'; ISO C99 and later do not support implicit function declarations}} \ + both-note {{previous implicit declaration}} \ + expected-warning {{call to undeclared function '_CFCalendarDecomposeAbsoluteTimeV'; ISO C99 and later do not support implicit function declarations}} \ c2x-error {{use of undeclared identifier '_CFCalendarDecomposeAbsoluteTimeV'}} } - printg("Hello, World!\n"); // expected-error{{call to undeclared function 'printg'; ISO C99 and later do not support implicit function declarations}} \ - expected-note{{did you mean 'printf'?}} \ + printg("Hello, World!\n"); // werror-error{{call to undeclared function 'printg'; ISO C99 and later do not support implicit function declarations}} \ + werror-note{{did you mean 'printf'?}} \ + expected-warning{{call to undeclared function 'printg'; ISO C99 and later do not support implicit function declarations}} \ c2x-error {{use of undeclared identifier 'printg'; did you mean 'printf'?}} - __builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}} \ + __builtin_is_les(1, 3); // both-error{{use of unknown builtin '__builtin_is_les'}} \ c2x-error {{unknown type name '__builtin_is_les'; did you mean '__builtin_va_list'?}} \ c2x-error {{expected identifier or '('}} \ c2x-error {{expected ')'}} \ c2x-note {{to match this '('}} } -Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error {{conflicting types}} +Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // both-error {{conflicting types}} return 0; } // Test the typo-correction callback in Sema::ImplicitlyDefineFunction -extern int sformatf(char *str, __const char *__restrict __format, ...); // expected-note{{'sformatf' declared here}} +extern int sformatf(char *str, __const char *__restrict __format, ...); // werror-note{{'sformatf' declared here}} void test_implicit(void) { int formats = 0; // c2x-note {{'formats' declared here}} - formatd("Hello, World!\n"); // expected-error{{call to undeclared function 'formatd'; ISO C99 and later do not support implicit function declarations}} \ - expected-note{{did you mean 'sformatf'?}} \ + formatd("Hello, World!\n"); // werror-error{{call to undeclared function 'formatd'; ISO C99 and later do not support implicit function declarations}} \ + werror-note{{did you mean 'sformatf'?}} \ + expected-warning{{call to undeclared function 'formatd'; ISO C99 and later do not support implicit function declarations}} \ c2x-error {{use of undeclared identifier 'formatd'; did you mean 'formats'?}} \ c2x-error {{called object type 'int' is not a function or function pointer}} } void test_suggestion(void) { - bark(); // expected-error {{call to undeclared function 'bark'; ISO C99 and later do not support implicit function declarations}} \ + bark(); // werror-error {{call to undeclared function 'bark'; ISO C99 and later do not support implicit function declarations}} \ + expected-warning {{call to undeclared function 'bark'; ISO C99 and later do not support implicit function declarations}} \ c2x-error {{use of undeclared identifier 'bark'}} - bork(); // expected-error {{call to undeclared function 'bork'; ISO C99 and later do not support implicit function declarations}} \ + bork(); // werror-error {{call to undeclared function 'bork'; ISO C99 and later do not support implicit function declarations}} \ + expected-warning {{call to undeclared function 'bork'; ISO C99 and later do not support implicit function declarations}} \ c2x-error {{use of undeclared identifier 'bork'}} } Index: clang/test/Sema/implicit-int.c =================================================================== --- clang/test/Sema/implicit-int.c +++ clang/test/Sema/implicit-int.c @@ -4,18 +4,18 @@ */ 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}} \ + ext-warning {{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'}} \ - ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \ + ext-warning {{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}} \ + ext-warning {{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 */ @@ -26,18 +26,18 @@ #define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */ void -h19_insline(n) /* ext-error {{parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} \ +h19_insline(n) /* ext-warning {{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'}} \ - ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \ + ext-warning {{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'}} \ - ext-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \ + ext-warning {{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/implicit-intel-builtin-decl.c =================================================================== --- clang/test/Sema/implicit-intel-builtin-decl.c +++ clang/test/Sema/implicit-intel-builtin-decl.c @@ -3,26 +3,26 @@ void f(void) { (void)_mm_getcsr(); // cxx-warning{{implicitly declaring library function '_mm_getcsr'}} \ - c-error{{call to undeclared library function '_mm_getcsr'}} \ + c-warning{{call to undeclared library function '_mm_getcsr'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_getcsr'}} _mm_setcsr(1); // cxx-warning{{implicitly declaring library function '_mm_setcsr'}} \ - c-error{{call to undeclared library function '_mm_setcsr'}} \ + c-warning{{call to undeclared library function '_mm_setcsr'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_setcsr'}} _mm_sfence(); // cxx-warning{{implicitly declaring library function '_mm_sfence'}} \ - c-error{{call to undeclared library function '_mm_sfence'}} \ + c-warning{{call to undeclared library function '_mm_sfence'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_sfence'}} _mm_clflush((void*)0); // cxx-warning{{implicitly declaring library function '_mm_clflush'}} \ - c-error{{call to undeclared library function '_mm_clflush'}} \ + c-warning{{call to undeclared library function '_mm_clflush'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_clflush'}} _mm_lfence(); // cxx-warning{{implicitly declaring library function '_mm_lfence'}} \ - c-error{{call to undeclared library function '_mm_lfence'}} \ + c-warning{{call to undeclared library function '_mm_lfence'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_lfence'}} _mm_mfence(); // cxx-warning{{implicitly declaring library function '_mm_mfence'}} \ - c-error{{call to undeclared library function '_mm_mfence'}} \ + c-warning{{call to undeclared library function '_mm_mfence'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_mfence'}} _mm_pause(); // cxx-warning{{implicitly declaring library function '_mm_pause'}} \ - c-error{{call to undeclared library function '_mm_pause'}} \ + c-warning{{call to undeclared library function '_mm_pause'}} \ expected-note{{include the header or explicitly provide a declaration for '_mm_pause'}} } Index: clang/test/Sema/implicit-ms-builtin-decl.c =================================================================== --- clang/test/Sema/implicit-ms-builtin-decl.c +++ clang/test/Sema/implicit-ms-builtin-decl.c @@ -2,9 +2,9 @@ // RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -verify %s -fms-extensions void f(void) { - (void)_byteswap_ushort(42); // expected-error{{call to undeclared library function '_byteswap_ushort'}} \ + (void)_byteswap_ushort(42); // expected-warning{{call to undeclared library function '_byteswap_ushort'}} \ // expected-note{{include the header or explicitly provide a declaration for '_byteswap_ushort'}} - (void)_byteswap_uint64(42LL); // expected-error{{call to undeclared library function '_byteswap_uint64'}} \ + (void)_byteswap_uint64(42LL); // expected-warning{{call to undeclared library function '_byteswap_uint64'}} \ // expected-note{{include the header or explicitly provide a declaration for '_byteswap_uint64'}} } @@ -21,9 +21,9 @@ #if defined(__x86_64__) void h(void) { - (void)__mulh(21, 2); // expected-error{{call to undeclared library function '__mulh'}} \ + (void)__mulh(21, 2); // expected-warning{{call to undeclared library function '__mulh'}} \ // expected-note{{include the header or explicitly provide a declaration for '__mulh'}} - (void)__umulh(21, 2); // expected-error{{call to undeclared library function '__umulh'}} \ + (void)__umulh(21, 2); // expected-warning{{call to undeclared library function '__umulh'}} \ // expected-note{{include the header or explicitly provide a declaration for '__umulh'}} } @@ -38,7 +38,7 @@ #if defined(i386) void h(void) { - (void)__mulh(21LL, 2LL); // expected-error{{call to undeclared function '__mulh'; ISO C99 and later do not support implicit function declarations}} - (void)__umulh(21ULL, 2ULL); // expected-error{{call to undeclared function '__umulh'; ISO C99 and later do not support implicit function declarations}} + (void)__mulh(21LL, 2LL); // expected-warning{{call to undeclared function '__mulh'; ISO C99 and later do not support implicit function declarations}} + (void)__umulh(21ULL, 2ULL); // expected-warning{{call to undeclared function '__umulh'; ISO C99 and later do not support implicit function declarations}} } #endif 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-error 2{{type specifier missing, defaults to 'int'}} +typedef xtype (*x)(void* handle); // expected-error {{function cannot return function type}} expected-warning 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,7 +3,7 @@ typedef struct _zend_module_entry zend_module_entry; struct _zend_module_entry { _efree((p)); // expected-error{{type name requires a specifier or qualifier}} \ - expected-error {{type specifier missing, defaults to 'int'}} + expected-warning {{type specifier missing, defaults to 'int'}} }; typedef struct _zend_function_entry { } zend_function_entry; 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) { // expected-error {{parameter 'x' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}} +int foo(x) { // expected-warning {{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/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-error {{type specifier missing, defaults to 'int'}} \ +a = b ? : 0; // expected-warning {{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-error {{type specifier missing, defaults to 'int'}} \ +new_a = goobar ?: 4; // expected-warning {{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}} @@ -37,7 +37,7 @@ typedef long long __m128i __attribute__((__vector_size__(16))); int PR23101(__m128i __x) { - return foo((__v2di)__x); // expected-error {{call to undeclared function 'foo'; ISO C99 and later do not support implicit function declarations}} \ + return foo((__v2di)__x); // expected-warning {{call to undeclared function 'foo'; ISO C99 and later do not support implicit function declarations}} \ // expected-error {{use of undeclared identifier '__v2di'}} } Index: clang/test/Sema/varargs.c =================================================================== --- clang/test/Sema/varargs.c +++ clang/test/Sema/varargs.c @@ -114,7 +114,7 @@ } void f14(int e, ...) { - // expected-error@+3 {{call to undeclared library function 'va_start'}} + // expected-warning@+3 {{call to undeclared library function 'va_start'}} // expected-note@+2 {{include the header }} // expected-error@+1 {{too few arguments to function call}} va_start(); Index: clang/test/Sema/vla.c =================================================================== --- clang/test/Sema/vla.c +++ clang/test/Sema/vla.c @@ -72,7 +72,7 @@ // PR36157 struct { int a[ // expected-error {{variable length array in struct}} - implicitly_declared() // expected-error {{call to undeclared function 'implicitly_declared'; ISO C99 and later do not support implicit function declarations}} + implicitly_declared() // expected-warning {{call to undeclared function 'implicitly_declared'; ISO C99 and later do not support implicit function declarations}} ]; }; int (*use_implicitly_declared)(void) = implicitly_declared; // ok, was implicitly declared at file scope Index: clang/test/SemaObjC/builtin_objc_lib_functions.m =================================================================== --- clang/test/SemaObjC/builtin_objc_lib_functions.m +++ clang/test/SemaObjC/builtin_objc_lib_functions.m @@ -1,29 +1,29 @@ // RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify // rdar://8592641 -Class f0(void) { return objc_getClass("a"); } // expected-error {{call to undeclared library function 'objc_getClass' with type 'id (const char *)'}} \ +Class f0(void) { return objc_getClass("a"); } // expected-warning {{call to undeclared library function 'objc_getClass' with type 'id (const char *)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_getClass'}} // rdar://8735023 -Class f1(void) { return objc_getMetaClass("a"); } // expected-error {{call to undeclared library function 'objc_getMetaClass' with type 'id (const char *)'}} \ +Class f1(void) { return objc_getMetaClass("a"); } // expected-warning {{call to undeclared library function 'objc_getMetaClass' with type 'id (const char *)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_getMetaClass'}} -void f2(id val) { objc_enumerationMutation(val); } // expected-error {{call to undeclared library function 'objc_enumerationMutation' with type 'void (id)'}} \ +void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{call to undeclared library function 'objc_enumerationMutation' with type 'void (id)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_enumerationMutation'}} -long double f3(id self, SEL op) { return objc_msgSend_fpret(self, op); } // expected-error {{call to undeclared library function 'objc_msgSend_fpret' with type 'long double (id, SEL, ...)'}} \ +long double f3(id self, SEL op) { return objc_msgSend_fpret(self, op); } // expected-warning {{call to undeclared library function 'objc_msgSend_fpret' with type 'long double (id, SEL, ...)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_msgSend_fpret'}} id f4(struct objc_super *super, SEL op) { // expected-warning {{declaration of 'struct objc_super' will not be visible outside of this function}} - return objc_msgSendSuper(super, op); // expected-error {{call to undeclared library function 'objc_msgSendSuper' with type 'id (struct objc_super *, SEL, ...)'}} \ + return objc_msgSendSuper(super, op); // expected-warning {{call to undeclared library function 'objc_msgSendSuper' with type 'id (struct objc_super *, SEL, ...)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_msgSendSuper'}} } id f5(id val, id *dest) { - return objc_assign_strongCast(val, dest); // expected-error {{call to undeclared library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \ + return objc_assign_strongCast(val, dest); // expected-warning {{call to undeclared library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_assign_strongCast'}} } int f6(Class exceptionClass, id exception) { - return objc_exception_match(exceptionClass, exception); // expected-error {{call to undeclared library function 'objc_exception_match' with type 'int (id, id)'}} \ + return objc_exception_match(exceptionClass, exception); // expected-warning {{call to undeclared library function 'objc_exception_match' with type 'int (id, id)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'objc_exception_match'}} } Index: clang/test/SemaObjC/builtin_objc_nslog.m =================================================================== --- clang/test/SemaObjC/builtin_objc_nslog.m +++ clang/test/SemaObjC/builtin_objc_nslog.m @@ -3,11 +3,11 @@ #include void f1(id arg) { - NSLog(@"%@", arg); // expected-error {{call to undeclared library function 'NSLog' with type 'void (id, ...)'}} \ + NSLog(@"%@", arg); // expected-warning {{call to undeclared library function 'NSLog' with type 'void (id, ...)'}} \ // expected-note {{include the header or explicitly provide a declaration for 'NSLog'}} } void f2(id str, va_list args) { - NSLogv(@"%@", args); // expected-error {{call to undeclared library function 'NSLogv' with type }} \ + NSLogv(@"%@", args); // expected-warning {{call to undeclared library function 'NSLogv' with type }} \ // expected-note {{include the header or explicitly provide a declaration for 'NSLogv'}} } Index: clang/test/SemaObjC/ivar-lookup-resolution-builtin.m =================================================================== --- clang/test/SemaObjC/ivar-lookup-resolution-builtin.m +++ clang/test/SemaObjC/ivar-lookup-resolution-builtin.m @@ -28,7 +28,7 @@ @implementation Test1 - (int) InstMethod { - return index; // expected-error {{call to undeclared library function 'index'}} \ + return index; // expected-warning {{call to undeclared library function 'index'}} \ // expected-note {{include the header or explicitly provide a declaration for 'index'}} \ // expected-error {{incompatible pointer to integer conversion returning}} } 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-error{{type specifier missing}} \ +- (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \ // expected-error{{expected ';' after method prototype}} @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-error@-8 {{type specifier missing, defaults to 'int'}} +// expected-warning@-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