2022-09-14 10:35:23 +00:00
From 9a95c7e534a4f0e7e992ea62cf3efc75fbdc04ae Mon Sep 17 00:00:00 2001
2022-09-14 07:42:01 +00:00
From: Aaron Ballman <aaron@aaronballman.com>
Date: Wed, 14 Sep 2022 09:38:39 +0200
Subject: [PATCH] [Clang 15.0.1] Downgrade implicit int and implicit function
declaration to warning only
The changes in Clang 15.0.0 which enabled these diagnostics as a warning which defaulted to an error caused disruption for people working on distributions such as Gentoo. There was an explicit request to downgrade these to be warning-only in Clang 15.0.1 with the expectation that Clang 16 will default the diagnostics to an error.
See https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 for more details on the discussion.
---
clang/docs/ReleaseNotes.rst | 21 +++++------
.../clang/Basic/DiagnosticSemaKinds.td | 8 ++---
clang/test/C/drs/dr0xx.c | 2 +-
clang/test/C/drs/dr1xx.c | 2 +-
2022-09-14 10:35:23 +00:00
.../CodeGen/PowerPC/builtins-ppc-p8vector.c | 28 +++++++--------
2022-09-14 09:54:16 +00:00
.../CodeGen/builtins-arm-msvc-compat-only.c | 4 +--
clang/test/CodeGen/neon-crypto.c | 2 +-
2022-09-14 07:42:01 +00:00
clang/test/Driver/cxx_for_opencl.clcpp | 2 +-
clang/test/FixIt/fixit.c | 2 +-
clang/test/Frontend/fixed_point_errors.c | 4 +--
clang/test/Frontend/fixed_point_not_enabled.c | 2 +-
.../Frontend/system-header-line-directive.c | 2 +-
clang/test/Headers/arm-cmse-header-ns.c | 10 +++---
clang/test/Modules/config_macros.m | 2 +-
clang/test/Modules/malformed-overload.m | 2 +-
clang/test/Modules/modulemap-locations.m | 6 ++--
clang/test/OpenMP/declare_mapper_messages.c | 4 +--
clang/test/PCH/chain-macro-override.c | 2 +-
clang/test/Parser/altivec.c | 4 +--
clang/test/Parser/attributes.c | 10 +++---
clang/test/Parser/declarators.c | 8 ++---
clang/test/Parser/objc-forcollection-neg-2.m | 2 +-
.../Preprocessor/macro_paste_msextensions.c | 2 +-
clang/test/Sema/__try.c | 2 +-
clang/test/Sema/aarch64-tme-errors.c | 2 +-
clang/test/Sema/address_spaces.c | 2 +-
clang/test/Sema/auto-type.c | 2 +-
clang/test/Sema/bitfield.c | 2 +-
clang/test/Sema/block-args.c | 2 +-
clang/test/Sema/block-literal.c | 2 +-
clang/test/Sema/builtin-setjmp.c | 4 +--
clang/test/Sema/builtins.c | 6 ++--
clang/test/Sema/crash-invalid-builtin.c | 2 +-
clang/test/Sema/cxx-as-c.c | 2 +-
clang/test/Sema/function.c | 6 ++--
clang/test/Sema/implicit-builtin-decl.c | 4 +--
clang/test/Sema/implicit-decl.c | 35 +++++++++++--------
clang/test/Sema/implicit-int.c | 12 +++----
clang/test/Sema/implicit-intel-builtin-decl.c | 14 ++++----
clang/test/Sema/implicit-ms-builtin-decl.c | 12 +++----
clang/test/Sema/invalid-decl.c | 2 +-
clang/test/Sema/invalid-struct-init.c | 2 +-
clang/test/Sema/redefinition.c | 2 +-
clang/test/Sema/typo-correction.c | 6 ++--
clang/test/Sema/varargs.c | 2 +-
clang/test/Sema/vla.c | 2 +-
.../SemaObjC/builtin_objc_lib_functions.m | 14 ++++----
clang/test/SemaObjC/builtin_objc_nslog.m | 4 +--
.../SemaObjC/ivar-lookup-resolution-builtin.m | 2 +-
clang/test/SemaObjC/protocols.m | 2 +-
clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl | 2 +-
2022-09-14 10:35:23 +00:00
51 files changed, 141 insertions(+), 141 deletions(-)
2022-09-14 07:42:01 +00:00
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index cbf3f4b37b5f..a26846a3eac4 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -245,18 +245,15 @@ Improvements to Clang's diagnostics
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.
+- The ``-Wimplicit-function-declaration`` warning diagnostic is now enabled by
+ default in C99, C11, and C17. As of C2x, support for implicit function
+ declarations has been removed, and the warning options will have no effect.
+ *NOTE* this warning will default to an error in Clang 16.
+- The ``-Wimplicit-int`` warning diagnostic is now enabled by default in C99,
+ C11, and C17. As of C2x, support for implicit int has been removed, and the
+ warning option will have no effect. Specifying ``-Wimplicit-int`` in C89 mode
+ will now issue warnings instead of being a noop.
+ *NOTE* this warning will default to an error in Clang 16.
- 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
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 6ff5b8de57fd..cb460401eb47 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -419,7 +419,7 @@ def warn_implicit_function_decl : Warning<
InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
def ext_implicit_function_decl_c99 : ExtWarn<
"call to undeclared function %0; ISO C99 and later do not support implicit "
- "function declarations">, InGroup<ImplicitFunctionDeclare>, DefaultError;
+ "function declarations">, InGroup<ImplicitFunctionDeclare>;
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 : ExtWarn<
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<ImplicitFunctionDeclare>, DefaultError;
+ InGroup<ImplicitFunctionDeclare>;
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 @@ 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 : ExtWarn<
"parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
- "support implicit int">, InGroup<ImplicitInt>, DefaultError;
+ "support implicit int">, InGroup<ImplicitInt>;
def err_param_default_argument : Error<
"C does not support default arguments">;
def err_param_default_argument_redefinition : Error<
@@ -10029,7 +10029,7 @@ def warn_receiver_forward_class : Warning<
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<ImplicitInt>, DefaultError;
+ "implicit int">, InGroup<ImplicitInt>;
def err_missing_type_specifier : Error<
"a type specifier is required for all declarations">;
def err_decimal_unsupported : Error<
diff --git a/clang/test/C/drs/dr0xx.c b/clang/test/C/drs/dr0xx.c
index 183382406475..3bfad3637d26 100644
--- a/clang/test/C/drs/dr0xx.c
+++ b/clang/test/C/drs/dr0xx.c
@@ -110,7 +110,7 @@ struct dr007_b;
* 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:
diff --git a/clang/test/C/drs/dr1xx.c b/clang/test/C/drs/dr1xx.c
index 70435b523765..1e430c5fb395 100644
--- a/clang/test/C/drs/dr1xx.c
+++ b/clang/test/C/drs/dr1xx.c
@@ -369,7 +369,7 @@ void dr163(void) {
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'}}
*/
}
2022-09-14 09:54:16 +00:00
diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c b/clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c
2022-09-14 10:35:23 +00:00
index af3d5c7d066b..54d2c70c0aa5 100644
2022-09-14 09:54:16 +00:00
--- a/clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c
+++ b/clang/test/CodeGen/PowerPC/builtins-ppc-p8vector.c
@@ -143,7 +143,7 @@ void test1() {
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 @@ void test1() {
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);
2022-09-14 10:35:23 +00:00
@@ -403,7 +403,7 @@ void test1() {
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 @@ void test1() {
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 @@ void test1() {
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 @@ void test1() {
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 @@ void test1() {
// CHECK: xor <16 x i8> [[T1]], <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
// CHECK-LE: [[T1:%.+]] = and <16 x i8>
// CHECK-LE: xor <16 x i8> [[T1]], <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
-// 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 @@ void test1() {
// CHECK: or <16 x i8> {{%.+}}, [[T1]]
// CHECK-LE: [[T1:%.+]] = xor <16 x i8> {{%.+}}, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
// 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> {{%.+}}, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
@@ -1166,7 +1166,7 @@ void test1() {
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 @@ void test1() {
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
2022-09-14 09:54:16 +00:00
diff --git a/clang/test/CodeGen/builtins-arm-msvc-compat-only.c b/clang/test/CodeGen/builtins-arm-msvc-compat-only.c
index 42cc9d70a142..c2b021b31174 100644
--- a/clang/test/CodeGen/builtins-arm-msvc-compat-only.c
+++ b/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 @@ void emit() {
}
// 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
diff --git a/clang/test/CodeGen/neon-crypto.c b/clang/test/CodeGen/neon-crypto.c
index 916886574416..1b29b1a53096 100644
--- a/clang/test/CodeGen/neon-crypto.c
+++ b/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)
}
2022-09-14 07:42:01 +00:00
diff --git a/clang/test/Driver/cxx_for_opencl.clcpp b/clang/test/Driver/cxx_for_opencl.clcpp
index fc2fc621791d..e3e89c53b888 100644
--- a/clang/test/Driver/cxx_for_opencl.clcpp
+++ b/clang/test/Driver/cxx_for_opencl.clcpp
@@ -13,6 +13,6 @@ kernel void k(){
auto a = get_local_id(1);
#ifndef __OPENCL_CPP_VERSION__
//expected-error@-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
}
diff --git a/clang/test/FixIt/fixit.c b/clang/test/FixIt/fixit.c
index eda00c35ccbb..c929b5abc5ee 100644
--- a/clang/test/FixIt/fixit.c
+++ b/clang/test/FixIt/fixit.c
@@ -29,7 +29,7 @@ int array0[5] = { [3] 3 }; // expected-warning {{GNU 'missing ='}}
// CHECK: int x
// CHECK: int y
-void f1(x, y) // expected-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}}
{
}
diff --git a/clang/test/Frontend/fixed_point_errors.c b/clang/test/Frontend/fixed_point_errors.c
index 6a711936f239..2d12a1ebb10b 100644
--- a/clang/test/Frontend/fixed_point_errors.c
+++ b/clang/test/Frontend/fixed_point_errors.c
@@ -228,9 +228,9 @@ void CheckSuffixOnIntegerLiterals(void) {
// Using auto
auto auto_fract = 0r; // expected-error{{invalid suffix 'r' on integer constant}}
- // expected-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
diff --git a/clang/test/Frontend/fixed_point_not_enabled.c b/clang/test/Frontend/fixed_point_not_enabled.c
index a1a60c5a6fa8..e7522213f98d 100644
--- a/clang/test/Frontend/fixed_point_not_enabled.c
+++ b/clang/test/Frontend/fixed_point_not_enabled.c
@@ -11,7 +11,7 @@ unsigned long _Accum u_long_accum; // expected-error{{compile with '-ffixed-p
// Aliased fixed point types
short _Accum short_accum; // expected-error{{compile with '-ffixed-point' to enable fixed point types}}
_Accum accum; // expected-error{{compile with '-ffixed-point' to enable fixed point types}}
- // expected-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
diff --git a/clang/test/Frontend/system-header-line-directive.c b/clang/test/Frontend/system-header-line-directive.c
index d5705e028daa..0de69196d76e 100644
--- a/clang/test/Frontend/system-header-line-directive.c
+++ b/clang/test/Frontend/system-header-line-directive.c
@@ -3,7 +3,7 @@
#include <noline.h>
#include <line-directive-in-system.h>
-// expected-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
diff --git a/clang/test/Headers/arm-cmse-header-ns.c b/clang/test/Headers/arm-cmse-header-ns.c
index dfbef2c00291..b4112a4fc79a 100644
--- a/clang/test/Headers/arm-cmse-header-ns.c
+++ b/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 <arm_cmse.h>
@@ -16,10 +16,10 @@ void func(callback_t fptr, void *p)
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'
diff --git a/clang/test/Modules/config_macros.m b/clang/test/Modules/config_macros.m
index dd071993809b..68ef6508afe6 100644
--- a/clang/test/Modules/config_macros.m
+++ b/clang/test/Modules/config_macros.m
@@ -5,7 +5,7 @@ int *test_foo(void) {
}
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}}
}
diff --git a/clang/test/Modules/malformed-overload.m b/clang/test/Modules/malformed-overload.m
index fd5d2f4f696b..369de580c9d7 100644
--- a/clang/test/Modules/malformed-overload.m
+++ b/clang/test/Modules/malformed-overload.m
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs/malformed-overload -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Wno-strict-prototypes -verify %s
-NSLog(@"%@", path); // expected-error {{expected parameter declarator}} expected-error {{expected ')'}} expected-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;
diff --git a/clang/test/Modules/modulemap-locations.m b/clang/test/Modules/modulemap-locations.m
index e5738e105263..08e06f47f5c8 100644
--- a/clang/test/Modules/modulemap-locations.m
+++ b/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}}
}
diff --git a/clang/test/OpenMP/declare_mapper_messages.c b/clang/test/OpenMP/declare_mapper_messages.c
index ae95dc81caef..ab9e63ede450 100644
--- a/clang/test/OpenMP/declare_mapper_messages.c
+++ b/clang/test/OpenMP/declare_mapper_messages.c
@@ -42,9 +42,9 @@ int fun(int arg) {
{}
#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'}}
{}
diff --git a/clang/test/PCH/chain-macro-override.c b/clang/test/PCH/chain-macro-override.c
index 26abae1cb9d5..62b05324ed44 100644
--- a/clang/test/PCH/chain-macro-override.c
+++ b/clang/test/PCH/chain-macro-override.c
@@ -10,7 +10,7 @@ int foo(void) {
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;
}
diff --git a/clang/test/Parser/altivec.c b/clang/test/Parser/altivec.c
index 66d2ca33ed91..3f344e9c5a13 100644
--- a/clang/test/Parser/altivec.c
+++ b/clang/test/Parser/altivec.c
@@ -97,8 +97,8 @@ vector unsigned long int v_uli; // nonaix-warning {{Use of 'long' with '__ve
// These should have warnings.
__vector long double vv_ld; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld; // expected-error {{cannot use 'long double' with '__vector'}}
-vector bool v_b; // expected-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__
diff --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c
index fe22c7e98a53..3375c4bc3741 100644
--- a/clang/test/Parser/attributes.c
+++ b/clang/test/Parser/attributes.c
@@ -7,7 +7,7 @@ foo(void) {
}
-__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 @@ int f2(y, __attribute__(()) x); // expected-error {{expected identifier}}
// This is parsed as a normal argument list (with two args that are implicit
// int) because the __attribute__ is a declspec.
-void f3(__attribute__(()) x, // expected-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 @@ int baz(int (__attribute__(()) *x)(long y));
void g1(void (*f1)(__attribute__(()) int x));
void g2(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}}
-void g3(void (*f3)(__attribute__(()) x, int y)); // expected-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}}
diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c
index c294bd085366..92cba09cdbbf 100644
--- a/clang/test/Parser/declarators.c
+++ b/clang/test/Parser/declarators.c
@@ -6,7 +6,7 @@ void f0(); /* expected-warning {{a function declaration without a prototype is d
void f1(int [*]);
void f2(int [const *]);
void f3(int [volatile const*]);
-int f4(*XX)(void); /* expected-error {{cannot return}} expected-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 @@ struct xyz test8(void) { return a; } // a should be be marked invalid, no diag.
// 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");
diff --git a/clang/test/Parser/objc-forcollection-neg-2.m b/clang/test/Parser/objc-forcollection-neg-2.m
index e28b74f3f442..f95dd1356bc3 100644
--- a/clang/test/Parser/objc-forcollection-neg-2.m
+++ b/clang/test/Parser/objc-forcollection-neg-2.m
@@ -24,7 +24,7 @@ typedef struct objc_object {
@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)
diff --git a/clang/test/Preprocessor/macro_paste_msextensions.c b/clang/test/Preprocessor/macro_paste_msextensions.c
index 1549ff5e5562..dcc5336b91c1 100644
--- a/clang/test/Preprocessor/macro_paste_msextensions.c
+++ b/clang/test/Preprocessor/macro_paste_msextensions.c
@@ -32,7 +32,7 @@ nested(baz) rise of the dead tokens
// rdar://8197149 - VC++ allows invalid token pastes: (##baz
#define foo(x) abc(x)
#define bar(y) foo(##baz(y))
-bar(q) // expected-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))
diff --git a/clang/test/Sema/__try.c b/clang/test/Sema/__try.c
index 9bfd914c013c..d0b2164198a2 100644
--- a/clang/test/Sema/__try.c
+++ b/clang/test/Sema/__try.c
@@ -50,7 +50,7 @@ void TEST(void) {
} // 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}}
}
diff --git a/clang/test/Sema/aarch64-tme-errors.c b/clang/test/Sema/aarch64-tme-errors.c
index 26e931b62bcb..63ce87f3dc6b 100644
--- a/clang/test/Sema/aarch64-tme-errors.c
+++ b/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'}}
}
diff --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c
index ff7a134e04eb..085bef9b72d3 100644
--- a/clang/test/Sema/address_spaces.c
+++ b/clang/test/Sema/address_spaces.c
@@ -9,7 +9,7 @@ void bar(_AS2 int a); // expected-error {{parameter may not be qualified with an
void foo(_AS3 float *a,
_AS1 float b) // expected-error {{parameter may not be qualified with an address space}}
{
- _AS2 *x;// expected-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}}
diff --git a/clang/test/Sema/auto-type.c b/clang/test/Sema/auto-type.c
index 1170c687c96a..bc845e37c2ae 100644
--- a/clang/test/Sema/auto-type.c
+++ b/clang/test/Sema/auto-type.c
@@ -37,7 +37,7 @@ void Issue53652(void) {
// GCC does not accept this either, for the same reason.
_Atomic(__auto_type) aat2 = a; // expected-error {{'__auto_type' not allowed here}} \
- // expected-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.
diff --git a/clang/test/Sema/bitfield.c b/clang/test/Sema/bitfield.c
index 468fe93485cc..b2982515da4d 100644
--- a/clang/test/Sema/bitfield.c
+++ b/clang/test/Sema/bitfield.c
@@ -84,5 +84,5 @@ struct Test6 {
};
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}}
};
diff --git a/clang/test/Sema/block-args.c b/clang/test/Sema/block-args.c
index 1e000abf4b36..245b2c02b806 100644
--- a/clang/test/Sema/block-args.c
+++ b/clang/test/Sema/block-args.c
@@ -37,7 +37,7 @@ void f0(void) {
// rdar://problem/8962770
void test4(void) {
- int (^f)(void) = ^((x)) { }; // expected-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
diff --git a/clang/test/Sema/block-literal.c b/clang/test/Sema/block-literal.c
index b760c647f0d1..4cb96fb49092 100644
--- a/clang/test/Sema/block-literal.c
+++ b/clang/test/Sema/block-literal.c
@@ -41,7 +41,7 @@ void test2(void) {
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; });
}
diff --git a/clang/test/Sema/builtin-setjmp.c b/clang/test/Sema/builtin-setjmp.c
index 5092d1665c19..94cd2652d0ab 100644
--- a/clang/test/Sema/builtin-setjmp.c
+++ b/clang/test/Sema/builtin-setjmp.c
@@ -35,10 +35,10 @@ void use(void) {
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 <setjmp.h> or explicitly provide a declaration for 'setjmp'}}
#else
// cxx-no-diagnostics
diff --git a/clang/test/Sema/builtins.c b/clang/test/Sema/builtins.c
index 702b40c63767..b3ef004bec0f 100644
--- a/clang/test/Sema/builtins.c
+++ b/clang/test/Sema/builtins.c
@@ -206,9 +206,9 @@ void test18(void) {
}
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) {
diff --git a/clang/test/Sema/crash-invalid-builtin.c b/clang/test/Sema/crash-invalid-builtin.c
index 26e5888a9e30..8f749f7b32bb 100644
--- a/clang/test/Sema/crash-invalid-builtin.c
+++ b/clang/test/Sema/crash-invalid-builtin.c
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
// PR23086
-__builtin_isinf(...); // expected-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 ()'}}
diff --git a/clang/test/Sema/cxx-as-c.c b/clang/test/Sema/cxx-as-c.c
index a5d1a4944c95..41d7350d1f15 100644
--- a/clang/test/Sema/cxx-as-c.c
+++ b/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;
};
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 1143fe8f50d5..43c8a6c8662b 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -18,7 +18,7 @@ void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
// PR1965
int t5(b); // expected-error {{parameter list without types}}
-int t6(int x, g); // expected-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 @@ int t14() {
}
// <rdar://problem/6097326>
-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, <rdar://problem/6127293>
diff --git a/clang/test/Sema/implicit-builtin-decl.c b/clang/test/Sema/implicit-builtin-decl.c
index 055ba7e70eb1..a54e652556c3 100644
--- a/clang/test/Sema/implicit-builtin-decl.c
+++ b/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 <stdlib.h> or explicitly provide a declaration for 'malloc'}} \
// expected-note{{'malloc' is a builtin with type 'void *}}
}
@@ -24,7 +24,7 @@ void h() {
void f2() {
fprintf(0, "foo"); // expected-warning{{declaration of built-in function 'fprintf' requires inclusion of the header <stdio.h>}} \
- 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
diff --git a/clang/test/Sema/implicit-decl.c b/clang/test/Sema/implicit-decl.c
index 351f70ea3366..ce26dcd3a122 100644
--- a/clang/test/Sema/implicit-decl.c
+++ b/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'}}
}
diff --git a/clang/test/Sema/implicit-int.c b/clang/test/Sema/implicit-int.c
index 477cd6977375..a5578cd0f65b 100644
--- a/clang/test/Sema/implicit-int.c
+++ b/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 @@ void f((x)); /* expected-warning {{type specifier missing, defaults to 'int'}}
#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
void
-h19_insline(n) /* 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'}} */
};
diff --git a/clang/test/Sema/implicit-intel-builtin-decl.c b/clang/test/Sema/implicit-intel-builtin-decl.c
index e7d17d9f19b9..1015d9bfe026 100644
--- a/clang/test/Sema/implicit-intel-builtin-decl.c
+++ b/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 <xmmintrin.h> 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 <xmmintrin.h> 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 <xmmintrin.h> 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 <emmintrin.h> 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 <emmintrin.h> 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 <emmintrin.h> 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 <emmintrin.h> or explicitly provide a declaration for '_mm_pause'}}
}
diff --git a/clang/test/Sema/implicit-ms-builtin-decl.c b/clang/test/Sema/implicit-ms-builtin-decl.c
index 1294bb6aa9aa..6bb2f6e3b8e2 100644
--- a/clang/test/Sema/implicit-ms-builtin-decl.c
+++ b/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 <stdlib.h> 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 <stdlib.h> or explicitly provide a declaration for '_byteswap_uint64'}}
}
@@ -21,9 +21,9 @@ void g(void) {
#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 <intrin.h> 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 <intrin.h> or explicitly provide a declaration for '__umulh'}}
}
@@ -38,7 +38,7 @@ void i(void) {
#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
diff --git a/clang/test/Sema/invalid-decl.c b/clang/test/Sema/invalid-decl.c
index 4f2680074dcd..ca5fa124e802 100644
--- a/clang/test/Sema/invalid-decl.c
+++ b/clang/test/Sema/invalid-decl.c
@@ -6,7 +6,7 @@ void test(void) {
// PR2400
-typedef xtype (*x)(void* handle); // expected-error {{function cannot return function type}} expected-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();
diff --git a/clang/test/Sema/invalid-struct-init.c b/clang/test/Sema/invalid-struct-init.c
index 72f6bbae12ab..0dd00b55ea21 100644
--- a/clang/test/Sema/invalid-struct-init.c
+++ b/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;
diff --git a/clang/test/Sema/redefinition.c b/clang/test/Sema/redefinition.c
index 7e690e1a917d..28f7f02bb251 100644
--- a/clang/test/Sema/redefinition.c
+++ b/clang/test/Sema/redefinition.c
@@ -4,7 +4,7 @@ int f(int);
int f(int a) { return 0; } // expected-error {{redefinition of 'f'}}
// <rdar://problem/6097326>
-int foo(x) { // 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;
diff --git a/clang/test/Sema/typo-correction.c b/clang/test/Sema/typo-correction.c
index ceab0e2634c5..4048488528d4 100644
--- a/clang/test/Sema/typo-correction.c
+++ b/clang/test/Sema/typo-correction.c
@@ -10,11 +10,11 @@ void PR21656(void) {
x = (float)arst; // expected-error-re {{use of undeclared identifier 'arst'{{$}}}}
}
-a = b ? : 0; // expected-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 @@ int c11Generic(int arg) {
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'}}
}
diff --git a/clang/test/Sema/varargs.c b/clang/test/Sema/varargs.c
index 2cb7270f604a..ebab2c9cd8b5 100644
--- a/clang/test/Sema/varargs.c
+++ b/clang/test/Sema/varargs.c
@@ -114,7 +114,7 @@ void f13(enum E1 e, ...) {
}
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 <stdarg.h>}}
// expected-error@+1 {{too few arguments to function call}}
va_start();
diff --git a/clang/test/Sema/vla.c b/clang/test/Sema/vla.c
index c6d61aac4515..73e24e90beea 100644
--- a/clang/test/Sema/vla.c
+++ b/clang/test/Sema/vla.c
@@ -72,7 +72,7 @@ int TransformBug(int a) {
// 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
diff --git a/clang/test/SemaObjC/builtin_objc_lib_functions.m b/clang/test/SemaObjC/builtin_objc_lib_functions.m
index 211c47246460..bda2f62678c0 100644
--- a/clang/test/SemaObjC/builtin_objc_lib_functions.m
+++ b/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 <objc/runtime.h> 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 <objc/runtime.h> 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 <objc/runtime.h> 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 <objc/message.h> 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 <objc/message.h> 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 <objc/objc-auto.h> 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 <objc/objc-exception.h> or explicitly provide a declaration for 'objc_exception_match'}}
}
diff --git a/clang/test/SemaObjC/builtin_objc_nslog.m b/clang/test/SemaObjC/builtin_objc_nslog.m
index 3c35a02d9b8a..ad7873fe1d47 100644
--- a/clang/test/SemaObjC/builtin_objc_nslog.m
+++ b/clang/test/SemaObjC/builtin_objc_nslog.m
@@ -3,11 +3,11 @@
#include <stdarg.h>
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 <Foundation/NSObjCRuntime.h> 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 <Foundation/NSObjCRuntime.h> or explicitly provide a declaration for 'NSLogv'}}
}
diff --git a/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m b/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m
index 09d69aca9f93..bbb1b4f6a168 100644
--- a/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m
+++ b/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 <strings.h> or explicitly provide a declaration for 'index'}} \
// expected-error {{incompatible pointer to integer conversion returning}}
}
diff --git a/clang/test/SemaObjC/protocols.m b/clang/test/SemaObjC/protocols.m
index ebb9b634b4b6..eb2734100769 100644
--- a/clang/test/SemaObjC/protocols.m
+++ b/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
diff --git a/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl b/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
index 2ea6d3bc4862..9e2869af87b4 100644
--- a/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
+++ b/clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
@@ -10,7 +10,7 @@ void foo(read_only pipe int p);
// expected-error@-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
--
2.37.2