[clang] 7deaeb2 - Use functions with prototypes when appropriate; NFC
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 7 12:29:44 PST 2022
Author: Aaron Ballman
Date: 2022-02-07T15:29:36-05:00
New Revision: 7deaeb2a056c1756ce6f2550d2ebb91b81b9ff29
URL: https://github.com/llvm/llvm-project/commit/7deaeb2a056c1756ce6f2550d2ebb91b81b9ff29
DIFF: https://github.com/llvm/llvm-project/commit/7deaeb2a056c1756ce6f2550d2ebb91b81b9ff29.diff
LOG: Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,
void func();
becomes
void func(void);
This is the fourth batch of tests being updated (there are a significant
number of other tests left to be updated).
Added:
Modified:
clang/test/Parser/CompoundStmtScope.c
clang/test/Parser/MicrosoftExtensions.c
clang/test/Parser/altivec-non-type-vector.c
clang/test/Parser/altivec-typedef-vector.c
clang/test/Parser/altivec.c
clang/test/Parser/asm.c
clang/test/Parser/atomic.c
clang/test/Parser/attr-availability.c
clang/test/Parser/attr-external-source-symbol.m
clang/test/Parser/attributes.c
clang/test/Parser/bad-control.c
clang/test/Parser/block-block-storageclass.c
clang/test/Parser/brackets.c
clang/test/Parser/builtin_classify_type.c
clang/test/Parser/builtin_source_location.c
clang/test/Parser/builtin_types_compatible.c
clang/test/Parser/c-namespace.c
clang/test/Parser/c11-noreturn.c
clang/test/Parser/captured-statements.c
clang/test/Parser/check_cast.c
clang/test/Parser/compound_literal.c
clang/test/Parser/debugger-import-module.m
clang/test/Parser/expressions.c
clang/test/Parser/expressions.m
clang/test/Parser/extension.c
clang/test/Parser/gcc-for-loop-init-compatibility.c
clang/test/Parser/goto.c
clang/test/Parser/implicit-casts.c
clang/test/Parser/ms-if-exists.c
clang/test/Parser/ms-inline-asm-nested-braces.c
clang/test/Parser/ms-inline-asm.c
clang/test/Parser/ms-seh.c
clang/test/SemaObjC/catch-invalid.m
clang/test/SemaObjC/catch-stmt.m
clang/test/SemaObjC/category-method-lookup.m
clang/test/SemaObjC/check-dup-objc-decls-1.m
clang/test/SemaObjC/circular-container.m
clang/test/SemaObjC/class-message-protocol-lookup.m
clang/test/SemaObjC/class-property-access.m
clang/test/SemaObjC/class-stub-attr.m
clang/test/SemaObjC/class-unavail-warning.m
clang/test/SemaObjC/compare-qualified-class.m
clang/test/SemaObjC/compound-init.m
clang/test/SemaObjC/comptypes-1.m
clang/test/SemaObjC/comptypes-2.m
clang/test/SemaObjC/comptypes-3.m
clang/test/SemaObjC/comptypes-4.m
clang/test/SemaObjC/comptypes-5.m
clang/test/SemaObjC/comptypes-7.m
clang/test/SemaObjC/comptypes-8.m
clang/test/SemaObjC/comptypes-legal.m
clang/test/SemaObjC/debugger-cast-result-to-id.m
clang/test/SemaObjC/delay-parsing-cfunctions.m
clang/test/SemaObjC/deprecate_function_containers.m
clang/test/SemaObjC/deprecated-objc-introspection.m
clang/test/SemaObjC/dictionary-literal-duplicates.m
clang/test/SemaObjC/dllexport.m
clang/test/SemaObjC/dllimport.m
clang/test/SemaObjC/encode-typeof-test.m
clang/test/SemaObjC/enum-fixed-type.m
clang/test/SemaObjC/error-outof-scope-property-use.m
clang/test/SemaObjC/exprs.m
clang/test/SemaObjC/externally-retained.m
clang/test/SemaObjC/foreach.m
clang/test/SemaObjC/format-cstrings-warning.m
clang/test/SemaObjC/format-ostrace-warning.m
clang/test/SemaObjC/format-size-spec-nsinteger.m
clang/test/SemaObjC/format-strings-objc.m
clang/test/SemaObjC/gc-attributes.m
clang/test/SemaObjC/iboutlet.m
clang/test/SemaObjC/id.m
clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m
clang/test/SemaObjC/illegal-nonarc-bridged-cast.m
clang/test/SemaObjC/infer-availability-from-init.m
clang/test/SemaObjC/instancetype.m
clang/test/SemaObjC/interface-1.m
clang/test/SemaObjC/invalid-code.m
clang/test/SemaObjC/invalid-receiver.m
clang/test/SemaObjC/ivar-sem-check-1.m
clang/test/SemaObjC/kindof.m
clang/test/SemaObjC/legacy-implementation-1.m
clang/test/SemaObjC/message.m
clang/test/SemaObjC/method-arg-qualifier-warning.m
clang/test/SemaObjC/method-bad-param.m
clang/test/SemaObjC/method-not-defined.m
clang/test/SemaObjC/method-sentinel-attr.m
clang/test/SemaObjC/mrc-weak.m
clang/test/SemaObjC/no-objc-exceptions.m
clang/test/SemaObjC/ns_returns_retained_block_return.m
clang/test/SemaObjC/nsobject-attribute.m
clang/test/SemaObjC/nullability.m
clang/test/SemaObjC/nullable-result.m
clang/test/SemaObjC/objc-array-literal.m
clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m
clang/test/SemaObjC/objc-buffered-methods.m
clang/test/SemaObjC/objc-class-property.m
clang/test/SemaObjC/objc-container-subscripting-1.m
clang/test/SemaObjC/objc-container-subscripting-2.m
clang/test/SemaObjC/objc-container-subscripting-3.m
clang/test/SemaObjC/objc-container-subscripting.m
clang/test/SemaObjC/objc-cstyle-args-in-methods.m
clang/test/SemaObjC/objc-dictionary-literal.m
clang/test/SemaObjC/objc-independent-class-attribute.m
clang/test/SemaObjC/objc-literal-fixit.m
clang/test/SemaObjC/objc-literal-nsnumber.m
clang/test/SemaObjC/objc-literal-sig.m
clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m
clang/test/SemaObjC/objc2-warn-weak-decl.m
clang/test/SemaObjC/objcbridge-attribute.m
clang/test/SemaObjC/opaque-is-access-warn.m
clang/test/SemaObjC/opaque-is-access.m
clang/test/SemaObjC/ovl-check.m
clang/test/SemaObjC/parameterized_classes.m
clang/test/SemaObjC/potentially-direct-selector.m
clang/test/SemaObjC/property-10.m
clang/test/SemaObjC/property-13.m
clang/test/SemaObjC/property-error-readonly-assign.m
clang/test/SemaObjC/property-expression-error.m
clang/test/SemaObjC/property-in-class-extension.m
clang/test/SemaObjC/property-not-lvalue.m
clang/test/SemaObjC/property.m
clang/test/SemaObjC/protocol-attribute.m
clang/test/SemaObjC/protocol-expr-1.m
clang/test/SemaObjC/protocol-expr-neg-1.m
clang/test/SemaObjC/protocol-typecheck.m
clang/test/SemaObjC/protocol-warn.m
clang/test/SemaObjC/rdar6248119.m
clang/test/SemaObjC/related-result-type-inference.m
clang/test/SemaObjC/resolve-method-in-global-pool.m
clang/test/SemaObjC/return.m
clang/test/SemaObjC/scope-check.m
clang/test/SemaObjC/selector-1.m
clang/test/SemaObjC/selector-2.m
clang/test/SemaObjC/selector-3.m
clang/test/SemaObjC/selector-4.m
clang/test/SemaObjC/selector-overload.m
clang/test/SemaObjC/setter-dotsyntax.m
clang/test/SemaObjC/sign-conversion.m
clang/test/SemaObjC/signed-char-bool-conversion.m
clang/test/SemaObjC/sizeof-interface.m
clang/test/SemaObjC/special-dep-unavail-warning.m
clang/test/SemaObjC/static-ivar-ref-1.m
clang/test/SemaObjC/super-property-notation.m
clang/test/SemaObjC/super.m
clang/test/SemaObjC/synchronized.m
clang/test/SemaObjC/synth-provisional-ivars-1.m
clang/test/SemaObjC/transfer-boxed-string-nullability.m
clang/test/SemaObjC/try-catch.m
clang/test/SemaObjC/ucn-objc-string.m
clang/test/SemaObjC/unguarded-availability-maccatalyst.m
clang/test/SemaObjC/unguarded-availability-new.m
clang/test/SemaObjC/unguarded-availability.m
clang/test/SemaObjC/uninit-variables.m
clang/test/SemaObjC/unknown-anytype.m
clang/test/SemaObjC/unqualified-to-qualified-class-warn.m
clang/test/SemaObjC/unused.m
clang/test/SemaObjC/warn-cast-of-sel-expr.m
clang/test/SemaObjC/warn-direct-ivar-access.m
clang/test/SemaObjC/warn-incompatible-builtin-types.m
clang/test/SemaObjC/warn-loop-analysis.m
clang/test/SemaObjC/warn-retain-block-property.m
clang/test/SemaObjC/warn-retain-cycle.m
clang/test/SemaObjC/warn-strict-selector-match.m
clang/test/SemaObjC/warn-unreachable.m
clang/test/SemaObjC/warn-unused-exception-param.m
clang/test/SemaObjC/warn-weak-field.m
Removed:
################################################################################
diff --git a/clang/test/Parser/CompoundStmtScope.c b/clang/test/Parser/CompoundStmtScope.c
index 4f991031d0c3a..ab056f05683e8 100644
--- a/clang/test/Parser/CompoundStmtScope.c
+++ b/clang/test/Parser/CompoundStmtScope.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void foo() {
+void foo(void) {
{
typedef float X;
}
diff --git a/clang/test/Parser/MicrosoftExtensions.c b/clang/test/Parser/MicrosoftExtensions.c
index 2af6c421bcce2..92cfb042ac22e 100644
--- a/clang/test/Parser/MicrosoftExtensions.c
+++ b/clang/test/Parser/MicrosoftExtensions.c
@@ -94,11 +94,11 @@ int * __sptr * __ptr32 ppsp32;
// Ignored type qualifiers after comma in declarator lists
typedef int ignored_quals_dummy1, const volatile __ptr32 __ptr64 __w64 __unaligned __sptr __uptr ignored_quals1; // expected-warning {{qualifiers after comma in declarator list are ignored}}
-typedef void(*ignored_quals_dummy2)(), __fastcall ignored_quals2; // expected-warning {{qualifiers after comma in declarator list are ignored}}
-typedef void(*ignored_quals_dummy3)(), __stdcall ignored_quals3; // expected-warning {{qualifiers after comma in declarator list are ignored}}
-typedef void(*ignored_quals_dummy4)(), __thiscall ignored_quals4; // expected-warning {{qualifiers after comma in declarator list are ignored}}
-typedef void(*ignored_quals_dummy5)(), __cdecl ignored_quals5; // expected-warning {{qualifiers after comma in declarator list are ignored}}
-typedef void(*ignored_quals_dummy6)(), __vectorcall ignored_quals6; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+typedef void(*ignored_quals_dummy2)(void), __fastcall ignored_quals2; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+typedef void(*ignored_quals_dummy3)(void), __stdcall ignored_quals3; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+typedef void(*ignored_quals_dummy4)(void), __thiscall ignored_quals4; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+typedef void(*ignored_quals_dummy5)(void), __cdecl ignored_quals5; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+typedef void(*ignored_quals_dummy6)(void), __vectorcall ignored_quals6; // expected-warning {{qualifiers after comma in declarator list are ignored}}
__declspec(align(16)) struct align_before_key1 {};
__declspec(align(16)) struct align_before_key2 {} align_before_key2_var;
diff --git a/clang/test/Parser/altivec-non-type-vector.c b/clang/test/Parser/altivec-non-type-vector.c
index d0868a60d0c3f..373284a4d6a9f 100644
--- a/clang/test/Parser/altivec-non-type-vector.c
+++ b/clang/test/Parser/altivec-non-type-vector.c
@@ -4,8 +4,8 @@
// RUN: %clang_cc1 -target-feature +altivec -fsyntax-only %s -triple powerpc-ibm-aix-xcoff
// RUN: %clang_cc1 -target-feature +altivec -fsyntax-only %s -triple powerpc-linux-gnu
-int vector();
+int vector(void);
-void test() {
+void test(void) {
vector unsigned int v = {0};
}
diff --git a/clang/test/Parser/altivec-typedef-vector.c b/clang/test/Parser/altivec-typedef-vector.c
index 5e00824b4de76..62c95f42728d7 100644
--- a/clang/test/Parser/altivec-typedef-vector.c
+++ b/clang/test/Parser/altivec-typedef-vector.c
@@ -6,6 +6,6 @@
typedef int vector;
-void test() {
+void test(void) {
vector unsigned int v = {0};
}
diff --git a/clang/test/Parser/altivec.c b/clang/test/Parser/altivec.c
index db2264e044002..3f344e9c5a13c 100644
--- a/clang/test/Parser/altivec.c
+++ b/clang/test/Parser/altivec.c
@@ -25,7 +25,7 @@ __vector __bool short vv___bs;
__vector __bool int vv___bi;
__vector __pixel vv_p;
__vector pixel vv__p;
-__vector int vf__r();
+__vector int vf__r(void);
void vf__a(__vector int a);
void vf__a2(int b, __vector int a);
@@ -50,7 +50,7 @@ vector __bool short v___bs;
vector __bool int v___bi;
vector __pixel v_p;
vector pixel v__p;
-vector int f__r();
+vector int f__r(void);
void f_a(vector int a);
void f_a2(int b, vector int a);
@@ -146,7 +146,7 @@ struct S {
vector short i32;
};
-void f() {
+void f(void) {
__vector unsigned int v = {0,0,0,0};
__vector int v__cast = (__vector int)v;
__vector int v_cast = (vector int)v;
diff --git a/clang/test/Parser/asm.c b/clang/test/Parser/asm.c
index b4cadee4669da..37b3ba3f46561 100644
--- a/clang/test/Parser/asm.c
+++ b/clang/test/Parser/asm.c
@@ -4,18 +4,18 @@
#error Extension 'gnu_asm' should be available by default
#endif
-void f1() {
+void f1(void) {
// PR7673: Some versions of GCC support an empty clobbers section.
asm ("ret" : : :);
}
-void f2() {
+void f2(void) {
asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}}
asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}}
}
-void a() __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}}
-void a() {
+void a(void) __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}}
+void a(void) {
__asm__(""); // ok
}
diff --git a/clang/test/Parser/atomic.c b/clang/test/Parser/atomic.c
index e8214966c3343..58a33aa057e7f 100644
--- a/clang/test/Parser/atomic.c
+++ b/clang/test/Parser/atomic.c
@@ -25,8 +25,8 @@ typedef int (*_Atomic atomic_int_ptr); // ext-warning {{'_Atomic' is a C11 exten
typedef int _Atomic *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
typedef _Atomic(int) *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
-typedef int int_fn();
-typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}} \
+typedef int int_fn(void);
+typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int (void)')}} \
// ext-warning {{'_Atomic' is a C11 extension}}
typedef _Atomic int atomic_int_array[3]; // ext-warning {{'_Atomic' is a C11 extension}}
typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int)[3]')}} \
@@ -44,4 +44,4 @@ typedef _Atomic(int __attribute__((vector_size(16)))) atomic_vector_int; // ext-
struct S
_Atomic atomic_s_no_missing_semicolon; // ext-warning {{'_Atomic' is a C11 extension}}
-int *const _Atomic atomic_return_type(); // ext-warning {{'_Atomic' is a C11 extension}}
+int *const _Atomic atomic_return_type(void); // ext-warning {{'_Atomic' is a C11 extension}}
diff --git a/clang/test/Parser/attr-availability.c b/clang/test/Parser/attr-availability.c
index 6a5c659ca1c25..eb934f344b94d 100644
--- a/clang/test/Parser/attr-availability.c
+++ b/clang/test/Parser/attr-availability.c
@@ -4,31 +4,31 @@
# error 'availability' attribute is not available
#endif
-void f0() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
+void f0(void) __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
-void f1() __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6)));
+void f1(void) __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6)));
-void f2() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6)));
+void f2(void) __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6)));
-void f3() __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6,introduced=10.2))); // expected-error{{redundant 'introduced' availability change; only the last specified change will be used}}
+void f3(void) __attribute__((availability(ios,deprecated=10.4.7,introduced=10,obsoleted=10.6,introduced=10.2))); // expected-error{{redundant 'introduced' availability change; only the last specified change will be used}}
-void f4() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable)));
+void f4(void) __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable)));
-void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}}
+void f5(void) __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}}
-void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
+void f6(void) __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
-void f7() __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f7(void) __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
-void f8() __attribute__((availability(macosx,message="a" L"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f8(void) __attribute__((availability(macosx,message="a" L"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
-void f9() __attribute__((availability(macosx,message=u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f9(void) __attribute__((availability(macosx,message=u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
-void f10() __attribute__((availability(macosx,message="a" u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f10(void) __attribute__((availability(macosx,message="a" u8"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
-void f11() __attribute__((availability(macosx,message=u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f11(void) __attribute__((availability(macosx,message=u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
-void f12() __attribute__((availability(macosx,message="a" u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+void f12(void) __attribute__((availability(macosx,message="a" u"b"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
// rdar://10095131
enum E{
diff --git a/clang/test/Parser/attr-external-source-symbol.m b/clang/test/Parser/attr-external-source-symbol.m
index 772fde0d48c96..752c748be84a7 100644
--- a/clang/test/Parser/attr-external-source-symbol.m
+++ b/clang/test/Parser/attr-external-source-symbol.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void function() __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration)));
+void function(void) __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration)));
__attribute__((external_source_symbol(language="Swift", defined_in="module")))
@interface I
@@ -14,71 +14,71 @@ CaseA __attribute__((external_source_symbol(generated_declaration))),
CaseB __attribute__((external_source_symbol(generated_declaration, language="Swift")))
} __attribute__((external_source_symbol(language = "Swift")));
-void f2()
+void f2(void)
__attribute__((external_source_symbol())); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f3()
+void f3(void)
__attribute__((external_source_symbol(invalid))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f4()
+void f4(void)
__attribute__((external_source_symbol(language))); // expected-error {{expected '=' after language}}
-void f5()
+void f5(void)
__attribute__((external_source_symbol(language=))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}}
-void f6()
+void f6(void)
__attribute__((external_source_symbol(defined_in=20))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}}
-void f7()
+void f7(void)
__attribute__((external_source_symbol(generated_declaration, generated_declaration))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
-void f8()
+void f8(void)
__attribute__((external_source_symbol(language="Swift", language="Swift"))); // expected-error {{duplicate 'language' clause in an 'external_source_symbol' attribute}}
-void f9()
+void f9(void)
__attribute__((external_source_symbol(defined_in="module", language="Swift", defined_in="foo"))); // expected-error {{duplicate 'defined_in' clause in an 'external_source_symbol' attribute}}
-void f10()
+void f10(void)
__attribute__((external_source_symbol(generated_declaration, language="Swift", defined_in="foo", generated_declaration, generated_declaration, language="Swift"))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
-void f11()
+void f11(void)
__attribute__((external_source_symbol(language="Objective-C++", defined_in="Some file with spaces")));
-void f12()
+void f12(void)
__attribute__((external_source_symbol(language="C Sharp", defined_in="file:////Hello world with spaces. cs")));
-void f13()
+void f13(void)
__attribute__((external_source_symbol(language=Swift))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}}
-void f14()
+void f14(void)
__attribute__((external_source_symbol(=))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f15()
+void f15(void)
__attribute__((external_source_symbol(="Swift"))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f16()
+void f16(void)
__attribute__((external_source_symbol("Swift", "module", generated_declaration))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f17()
+void f17(void)
__attribute__((external_source_symbol(language="Swift", "generated_declaration"))); // expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
-void f18()
+void f18(void)
__attribute__((external_source_symbol(language= =))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}}
-void f19()
+void f19(void)
__attribute__((external_source_symbol(defined_in="module" language="swift"))); // expected-error {{expected ')'}} expected-note {{to match this '('}}
-void f20()
+void f20(void)
__attribute__((external_source_symbol(defined_in="module" language="swift" generated_declaration))); // expected-error {{expected ')'}} expected-note {{to match this '('}}
-void f21()
+void f21(void)
__attribute__((external_source_symbol(defined_in= language="swift"))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}}
-void f22()
+void f22(void)
__attribute__((external_source_symbol)); // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
-void f23()
+void f23(void)
__attribute__((external_source_symbol(defined_in=, language="swift" generated_declaration))); // expected-error {{expected string literal for source container name in 'external_source_symbol' attribute}} expected-error{{expected ')'}} expected-note{{to match this '('}}
-void f24()
+void f24(void)
__attribute__((external_source_symbol(language = generated_declaration))); // expected-error {{expected string literal for language name in 'external_source_symbol' attribute}}
-void f25()
+void f25(void)
__attribute__((external_source_symbol(defined_in=123, defined_in="module"))); // expected-error {{expected string literal for source container name in 'external_source_symbol'}} expected-error {{duplicate 'defined_in' clause in an 'external_source_symbol' attribute}}
-void f26()
+void f26(void)
__attribute__((external_source_symbol(language=Swift, language="Swift", error))); // expected-error {{expected string literal for language name in 'external_source_symbol'}} expected-error {{duplicate 'language' clause in an 'external_source_symbol' attribute}} expected-error {{expected 'language', 'defined_in', or 'generated_declaration'}}
diff --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c
index 26ece79ddcd2a..60cd50958e0ea 100644
--- a/clang/test/Parser/attributes.c
+++ b/clang/test/Parser/attributes.c
@@ -55,7 +55,7 @@ void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn));
// PR6287
-void __attribute__((returns_twice)) returns_twice_test();
+void __attribute__((returns_twice)) returns_twice_test(void);
int aligned(int);
int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error 2{{expected ')'}} expected-note {{to match}} expected-warning {{does not declare anything}}
@@ -70,7 +70,7 @@ int testFundef1(int *a) __attribute__((nonnull(1))) { // \
}
// noreturn is lifted to type qualifier
-void testFundef2() __attribute__((noreturn)) { // \
+void testFundef2(void) __attribute__((noreturn)) { // \
// expected-warning {{GCC does not allow 'noreturn' attribute in this position on a function definition}}
testFundef2();
}
@@ -90,7 +90,7 @@ int testFundef4(int *a) __attribute__((nonnull(1))) // \
}
// GCC allows these
-void testFundef5() __attribute__(()) { }
+void testFundef5(void) __attribute__(()) { }
__attribute__((pure)) int testFundef6(int a) { return a; }
diff --git a/clang/test/Parser/bad-control.c b/clang/test/Parser/bad-control.c
index 72614eb2551e7..b76a395508316 100644
--- a/clang/test/Parser/bad-control.c
+++ b/clang/test/Parser/bad-control.c
@@ -1,10 +1,10 @@
/* RUN: %clang_cc1 -fsyntax-only -verify %s
*/
-void foo() {
+void foo(void) {
break; /* expected-error {{'break' statement not in loop or switch statement}} */
}
-void foo2() {
+void foo2(void) {
continue; /* expected-error {{'continue' statement not in loop statement}} */
}
@@ -15,10 +15,10 @@ int pr8880_9 (int first) {
}
}
-void pr8880_24() {
+void pr8880_24(void) {
for (({break;});;); // expected-error {{'break' statement not in loop or switch statement}}
}
-void pr8880_25() {
+void pr8880_25(void) {
for (({continue;});;); // expected-error {{'continue' statement not in loop statement}}
}
diff --git a/clang/test/Parser/block-block-storageclass.c b/clang/test/Parser/block-block-storageclass.c
index 53cd997252259..0045fcfbabeb1 100644
--- a/clang/test/Parser/block-block-storageclass.c
+++ b/clang/test/Parser/block-block-storageclass.c
@@ -3,7 +3,7 @@
int printf(const char *, ...);
void _Block_byref_release(void*src){}
-int main() {
+int main(void) {
__block int X = 1234;
__block const char * message = "HELLO";
diff --git a/clang/test/Parser/brackets.c b/clang/test/Parser/brackets.c
index 4ce38bd1ce337..a651c35d073a8 100644
--- a/clang/test/Parser/brackets.c
+++ b/clang/test/Parser/brackets.c
@@ -4,7 +4,7 @@
// RUN: %clang_cc1 -fsyntax-only %t -x c -DFIXIT
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s -strict-whitespace
-void test1() {
+void test1(void) {
int a[] = {0,1,1,2,3};
int []b = {0,1,4,9,16};
// expected-error at -1{{brackets are not allowed here; to declare an array, place the brackets after the identifier}}
@@ -32,7 +32,7 @@ struct S {
} s;
#ifndef FIXIT
-void test2() {
+void test2(void) {
int [][][];
// expected-error at -1{{expected identifier or '('}}
// CHECK: {{^}} int [][][];
@@ -47,7 +47,7 @@ void test2() {
};
}
-void test3() {
+void test3(void) {
int [5] *;
// expected-error at -1{{expected identifier or '('}}
// CHECK: {{^}} int [5] *;
diff --git a/clang/test/Parser/builtin_classify_type.c b/clang/test/Parser/builtin_classify_type.c
index 94434e9f2ee41..67654511330a5 100644
--- a/clang/test/Parser/builtin_classify_type.c
+++ b/clang/test/Parser/builtin_classify_type.c
@@ -2,7 +2,7 @@
struct foo { int a; };
-int main() {
+int main(void) {
int a;
float b;
double d;
diff --git a/clang/test/Parser/builtin_source_location.c b/clang/test/Parser/builtin_source_location.c
index 441c87b009491..02778bd86697c 100644
--- a/clang/test/Parser/builtin_source_location.c
+++ b/clang/test/Parser/builtin_source_location.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-int main() {
+int main(void) {
int line = __builtin_LINE();
__builtin_LINE(42); // expected-error {{expected ')'}}
__builtin_LINE(double); // expected-error {{expected ')'}}
diff --git a/clang/test/Parser/builtin_types_compatible.c b/clang/test/Parser/builtin_types_compatible.c
index d967a7023a490..e74cf76943a46 100644
--- a/clang/test/Parser/builtin_types_compatible.c
+++ b/clang/test/Parser/builtin_types_compatible.c
@@ -18,7 +18,7 @@ extern double funcDouble(double);
__builtin_choose_expr(__builtin_types_compatible_p(typeof(expr), float), funcFloat(expr), \
__builtin_choose_expr(__builtin_types_compatible_p(typeof(expr), double), funcDouble(expr), (void)0)))
-static void test()
+static void test(void)
{
int a;
float b;
@@ -44,7 +44,7 @@ static void test()
enum E1 { E1Foo };
enum E2 { E2Foo };
-static void testGccCompatibility() {
+static void testGccCompatibility(void) {
_Static_assert(__builtin_types_compatible_p(const volatile int, int), "");
_Static_assert(__builtin_types_compatible_p(int[5], int[]), "");
_Static_assert(!__builtin_types_compatible_p(int[5], int[4]), "");
diff --git a/clang/test/Parser/c-namespace.c b/clang/test/Parser/c-namespace.c
index fbef09e0cd795..b0f35b141f371 100644
--- a/clang/test/Parser/c-namespace.c
+++ b/clang/test/Parser/c-namespace.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only %s
-void bla1() {
+void bla1(void) {
struct XXX;
int XXX;
}
diff --git a/clang/test/Parser/c11-noreturn.c b/clang/test/Parser/c11-noreturn.c
index 6666731f29900..0ce883ea43e36 100644
--- a/clang/test/Parser/c11-noreturn.c
+++ b/clang/test/Parser/c11-noreturn.c
@@ -1,15 +1,15 @@
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s
-_Noreturn int f();
-int _Noreturn f(); // expected-note {{previous}}
+_Noreturn int f(void);
+int _Noreturn f(void); // expected-note {{previous}}
int f _Noreturn(); // expected-error {{expected ';'}} expected-error 2{{}}
-int f() _Noreturn; // expected-error {{'_Noreturn' keyword must precede function declarator}}
+int f(void) _Noreturn; // expected-error {{'_Noreturn' keyword must precede function declarator}}
_Noreturn char c1; // expected-error {{'_Noreturn' can only appear on functions}}
char _Noreturn c2; // expected-error {{'_Noreturn' can only appear on functions}}
-typedef _Noreturn int g(); // expected-error {{'_Noreturn' can only appear on functions}}
+typedef _Noreturn int g(void); // expected-error {{'_Noreturn' can only appear on functions}}
_Noreturn int; // expected-error {{'_Noreturn' can only appear on functions}} expected-warning {{does not declare anything}}
_Noreturn struct S; // expected-error {{'_Noreturn' can only appear on functions}}
diff --git a/clang/test/Parser/captured-statements.c b/clang/test/Parser/captured-statements.c
index 30dddb549c9c7..2993b3578fea8 100644
--- a/clang/test/Parser/captured-statements.c
+++ b/clang/test/Parser/captured-statements.c
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 -verify %s
-void test1()
+void test1(void)
{
#pragma clang __debug captured x // expected-warning {{extra tokens at end of #pragma clang __debug captured directive}}
{
}
}
-void test2()
+void test2(void)
{
#pragma clang __debug captured
int x; // expected-error {{expected '{'}}
diff --git a/clang/test/Parser/check_cast.c b/clang/test/Parser/check_cast.c
index 790ee409c976e..a2b6d861e5f29 100644
--- a/clang/test/Parser/check_cast.c
+++ b/clang/test/Parser/check_cast.c
@@ -3,7 +3,7 @@ struct foo {
int a;
};
-int main() {
+int main(void) {
struct foo xxx;
int i;
diff --git a/clang/test/Parser/compound_literal.c b/clang/test/Parser/compound_literal.c
index 00544996e3c1a..808ca63f97d9e 100644
--- a/clang/test/Parser/compound_literal.c
+++ b/clang/test/Parser/compound_literal.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s
// expected-no-diagnostics
-int main() {
+int main(void) {
char *s;
s = (char []){"whatever"};
s = (char(*)){s};
diff --git a/clang/test/Parser/debugger-import-module.m b/clang/test/Parser/debugger-import-module.m
index b6001aed6a89e..7f65583c5c243 100644
--- a/clang/test/Parser/debugger-import-module.m
+++ b/clang/test/Parser/debugger-import-module.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -fdebugger-support -verify %s
// expected-no-diagnostics
-void importAModule() {
+void importAModule(void) {
@import AModuleThatDoesntExist
}
diff --git a/clang/test/Parser/expressions.c b/clang/test/Parser/expressions.c
index 64b44470f7e74..82556c091206f 100644
--- a/clang/test/Parser/expressions.c
+++ b/clang/test/Parser/expressions.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void test1() {
+void test1(void) {
if (sizeof (int){ 1}) {} // sizeof compound literal
if (sizeof (int)) {} // sizeof type
@@ -18,19 +18,19 @@ int test3(int a, int b, int c) {
return a = b = c;
}
-int test4() {
+int test4(void) {
test4();
return 0;
}
struct X0 { struct { struct { int c[10][9]; } b; } a; };
-int test_offsetof() {
+int test_offsetof(void) {
(void)__builtin_offsetof(struct X0, a.b.c[4][5]);
return 0;
}
-void test_sizeof(){
+void test_sizeof(void){
int arr[10];
(void)sizeof arr[0];
(void)sizeof(arr[0]);
@@ -38,7 +38,7 @@ void test_sizeof(){
}
// PR3418
-int test_leading_extension() {
+int test_leading_extension(void) {
__extension__ (*(char*)0) = 1; // expected-warning {{indirection of non-volatile null pointer}} \
// expected-note {{consider using __builtin_trap}}
return 0;
@@ -53,7 +53,7 @@ int test6(void) {
}
// PR8394
-void test7() {
+void test7(void) {
({} // expected-note {{to match}}
; // expected-error {{expected ')'}}
}
@@ -61,7 +61,7 @@ void test7() {
// PR16992
struct pr16992 { int x; };
-void func_16992 () {
+void func_16992 (void) {
int x1 = sizeof int; // expected-error {{expected parentheses around type name in sizeof expression}}
int x2 = sizeof struct pr16992; // expected-error {{expected parentheses around type name in sizeof expression}}
int x3 = __alignof int; // expected-error {{expected parentheses around type name in __alignof expression}}
@@ -69,7 +69,7 @@ void func_16992 () {
}
void callee(double, double);
-void test8() {
+void test8(void) {
callee(foobar, // expected-error {{use of undeclared identifier 'foobar'}}
fizbin); // expected-error {{use of undeclared identifier 'fizbin'}}
}
diff --git a/clang/test/Parser/expressions.m b/clang/test/Parser/expressions.m
index 1f1005a792a77..ab9aaf8ffd306 100644
--- a/clang/test/Parser/expressions.m
+++ b/clang/test/Parser/expressions.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void test1() {
+void test1(void) {
@"s"; // expected-warning {{expression result unused}}
}
diff --git a/clang/test/Parser/extension.c b/clang/test/Parser/extension.c
index fd4cf80867487..b675f6064802b 100644
--- a/clang/test/Parser/extension.c
+++ b/clang/test/Parser/extension.c
@@ -11,7 +11,7 @@ __extension__ typedef struct
/* Decl/expr __extension__ marker. */
-void bar() {
+void bar(void) {
__extension__ int i;
int j;
__extension__ (j = 10LL);
diff --git a/clang/test/Parser/gcc-for-loop-init-compatibility.c b/clang/test/Parser/gcc-for-loop-init-compatibility.c
index dc88f083955da..8bf439d935f8e 100644
--- a/clang/test/Parser/gcc-for-loop-init-compatibility.c
+++ b/clang/test/Parser/gcc-for-loop-init-compatibility.c
@@ -6,7 +6,7 @@
// expected-no-diagnostics
#endif
-void foo() {
+void foo(void) {
#ifndef C99
// expected-warning at +2{{GCC does not allow variable declarations in for loop initializers before C99}}
#endif
diff --git a/clang/test/Parser/goto.c b/clang/test/Parser/goto.c
index a3e01174eb94f..f34e7e21f60c1 100644
--- a/clang/test/Parser/goto.c
+++ b/clang/test/Parser/goto.c
@@ -1,12 +1,12 @@
/* RUN: %clang_cc1 -fsyntax-only -verify %s
*/
-void test1() {
+void test1(void) {
goto ; /* expected-error {{expected identifier}} */
}
-void test2() {
+void test2(void) {
l: /* expected-note {{previous definition is here}} */
{
diff --git a/clang/test/Parser/implicit-casts.c b/clang/test/Parser/implicit-casts.c
index a2b31f929fb3a..65a196810bc0c 100644
--- a/clang/test/Parser/implicit-casts.c
+++ b/clang/test/Parser/implicit-casts.c
@@ -3,7 +3,7 @@ _Complex double X;
void test1(int c) {
X = 5;
}
-void test2() {
+void test2(void) {
int i;
double d = i;
double _Complex a = 5;
@@ -12,9 +12,9 @@ void test2() {
a = 5;
d = i;
}
-int test3() {
+int test3(void) {
int a[2];
- a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int ()'}}
+ a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int (void)'}}
return 0;
}
short x; void test4(char c) { x += c; }
diff --git a/clang/test/Parser/ms-if-exists.c b/clang/test/Parser/ms-if-exists.c
index 7dd20544a6b4d..66b85424757e3 100644
--- a/clang/test/Parser/ms-if-exists.c
+++ b/clang/test/Parser/ms-if-exists.c
@@ -4,7 +4,7 @@
struct Type {
};
-void test_if_exists_stmts() {
+void test_if_exists_stmts(void) {
int b = 0;
__if_exists(Type) {
b++;
@@ -22,7 +22,7 @@ void test_if_exists_stmts() {
}
}
-int if_exists_creates_no_scope() {
+int if_exists_creates_no_scope(void) {
__if_exists(Type) {
int x; // 'x' is declared in the parent scope.
}
@@ -48,7 +48,7 @@ __if_not_exists(Type_not) {
int var244;
}
-void test_if_exists_init_list() {
+void test_if_exists_init_list(void) {
int array1[] = {
0,
@@ -77,7 +77,7 @@ void test_if_exists_init_list() {
}
-void test_nested_if_exists() {
+void test_nested_if_exists(void) {
__if_exists(Type) {
int x = 42;
__if_not_exists(Type_not) {
diff --git a/clang/test/Parser/ms-inline-asm-nested-braces.c b/clang/test/Parser/ms-inline-asm-nested-braces.c
index 58b055bb1a2aa..90712ef175260 100644
--- a/clang/test/Parser/ms-inline-asm-nested-braces.c
+++ b/clang/test/Parser/ms-inline-asm-nested-braces.c
@@ -1,7 +1,7 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks
-int t_fail() { // expected-note {{to match this}}
+int t_fail(void) { // expected-note {{to match this}}
__asm
{ // expected-note {{to match this}}
{ // expected-note {{to match this}}
diff --git a/clang/test/Parser/ms-inline-asm.c b/clang/test/Parser/ms-inline-asm.c
index c6af1ea5126b7..44f84a542f3fb 100644
--- a/clang/test/Parser/ms-inline-asm.c
+++ b/clang/test/Parser/ms-inline-asm.c
@@ -10,33 +10,33 @@ void t1(void) { M }
void t2(void) { __asm int 2ch }
void t3(void) { __asm M2 2ch }
void t4(void) { __asm mov eax, fs:[10h] }
-void t5() {
+void t5(void) {
__asm {
int 0x2c ; } asm comments are fun! }{
}
__asm {}
}
-int t6() {
+int t6(void) {
__asm int 3 ; } comments for single-line asm
__asm {}
__asm int 4
return 10;
}
-void t7() {
+void t7(void) {
__asm {
push ebx
mov ebx, 07h
pop ebx
}
}
-void t8() {
+void t8(void) {
__asm nop __asm nop __asm nop
}
-void t9() {
+void t9(void) {
__asm nop __asm nop ; __asm nop
}
-void t10() {
+void t10(void) {
__asm {
mov eax, 0
__asm {
@@ -47,21 +47,21 @@ void t10() {
}
}
}
-void t11() {
+void t11(void) {
do { __asm mov eax, 0 __asm { __asm mov edx, 1 } } while(0);
}
-void t12() {
+void t12(void) {
__asm jmp label // expected-error {{use of undeclared label 'label'}}
}
-void t13() {
+void t13(void) {
__asm m{o}v eax, ebx // expected-error {{unknown token in expression}}
}
-void t14() {
+void t14(void) {
enum { A = 1, B };
__asm mov eax, offset A // expected-error {{offset operator cannot yet handle constants}}
}
-int t_fail() { // expected-note {{to match this}}
+int t_fail(void) { // expected-note {{to match this}}
__asm
__asm { // expected-error 3 {{expected}} expected-note {{to match this}}
diff --git a/clang/test/Parser/ms-seh.c b/clang/test/Parser/ms-seh.c
index 68c2e3091547b..90a6c62525316 100644
--- a/clang/test/Parser/ms-seh.c
+++ b/clang/test/Parser/ms-seh.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
-void f() {
+void f(void) {
int a;
__try a; // expected-error {{expected '{'}} expected-warning {{expression result unused}}
@@ -9,14 +9,14 @@ void f() {
}
} // expected-error {{expected '__except' or '__finally' block}}
-void g() {
+void g(void) {
int a;
__try {
} __except(1) a; // expected-error {{expected '{'}} expected-warning {{expression result unused}}
}
-void h() {
+void h(void) {
int a;
__try {
diff --git a/clang/test/SemaObjC/catch-invalid.m b/clang/test/SemaObjC/catch-invalid.m
index 352b2fbaa8ed2..9903d9308a02a 100644
--- a/clang/test/SemaObjC/catch-invalid.m
+++ b/clang/test/SemaObjC/catch-invalid.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fobjc-exceptions -fobjc-runtime=ios -verify %s
extern void g(void);
-void f() {
+void f(void) {
@try {
g();
} @catch (Class c) { // expected-error{{@catch parameter is not a pointer to an interface type}}
diff --git a/clang/test/SemaObjC/catch-stmt.m b/clang/test/SemaObjC/catch-stmt.m
index dcb47640e844f..c6fff9cf74d84 100644
--- a/clang/test/SemaObjC/catch-stmt.m
+++ b/clang/test/SemaObjC/catch-stmt.m
@@ -2,7 +2,7 @@
@interface A @end
@protocol P;
-void f() {
+void f(void) {
@try {
} @catch (void a) { // expected-error{{@catch parameter is not a pointer to an interface type}}
} @catch (int) { // expected-error{{@catch parameter is not a pointer to an interface type}}
diff --git a/clang/test/SemaObjC/category-method-lookup.m b/clang/test/SemaObjC/category-method-lookup.m
index 6239e948dce4f..3435ed5b86c03 100644
--- a/clang/test/SemaObjC/category-method-lookup.m
+++ b/clang/test/SemaObjC/category-method-lookup.m
@@ -28,5 +28,5 @@ -(int)callsReturnsInt {
}
@end
-int main() {return 0;}
+int main(void) {return 0;}
diff --git a/clang/test/SemaObjC/check-dup-objc-decls-1.m b/clang/test/SemaObjC/check-dup-objc-decls-1.m
index 7a2cd40424d3c..8867afef7159a 100644
--- a/clang/test/SemaObjC/check-dup-objc-decls-1.m
+++ b/clang/test/SemaObjC/check-dup-objc-decls-1.m
@@ -22,7 +22,7 @@ @implementation FooBar // expected-warning {{cannot find interface declaration f
@interface Gorf @end // expected-error {{redefinition of 'Gorf' as
diff erent kind of symbol}} expected-note {{previous definition is here}}
-void Gorf() // expected-error {{redefinition of 'Gorf' as
diff erent kind of symbol}}
+void Gorf(void) // expected-error {{redefinition of 'Gorf' as
diff erent kind of symbol}}
{
int Bar, Foo, FooBar;
}
diff --git a/clang/test/SemaObjC/circular-container.m b/clang/test/SemaObjC/circular-container.m
index 1f06595f77bec..a0e6bf596e956 100644
--- a/clang/test/SemaObjC/circular-container.m
+++ b/clang/test/SemaObjC/circular-container.m
@@ -103,7 +103,7 @@ void checkNSMutableOrderedSetParam(NSMutableOrderedSet *s) { // expected-note {{
[s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}}
}
-void checkNSMutableArray() {
+void checkNSMutableArray(void) {
NSMutableArray *a = nil; // expected-note 5 {{'a' declared here}} 5
[a addObject:a]; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}}
@@ -113,7 +113,7 @@ void checkNSMutableArray() {
a[0] = a; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}}
}
-void checkNSMutableDictionary() {
+void checkNSMutableDictionary(void) {
NSMutableDictionary *d = nil; // expected-note 4 {{'d' declared here}}
[d setObject:d forKey:@"key"]; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}}
@@ -122,19 +122,19 @@ void checkNSMutableDictionary() {
d[@"key"] = d; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}}
}
-void checkNSMutableSet() {
+void checkNSMutableSet(void) {
NSMutableSet *s = nil; // expected-note {{'s' declared here}}
[s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}}
}
-void checkNSCountedSet() {
+void checkNSCountedSet(void) {
NSCountedSet *s = nil; // expected-note {{'s' declared here}}
[s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}}
}
-void checkNSMutableOrderedSet() {
+void checkNSMutableOrderedSet(void) {
NSMutableOrderedSet *s = nil; // expected-note 5 {{'s' declared here}}
[s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}}
@@ -180,7 +180,7 @@ - (void)meth {
@end
-void subclassingNSMutableArray() {
+void subclassingNSMutableArray(void) {
FootableArray *a = nil; // expected-note 5 {{'a' declared here}} 5
[a addObject:a]; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}}
@@ -190,7 +190,7 @@ void subclassingNSMutableArray() {
a[0] = a; // expected-warning {{adding 'a' to 'a' might cause circular dependency in container}}
}
-void subclassingNSMutableDictionary() {
+void subclassingNSMutableDictionary(void) {
FootableDictionary *d = nil; // expected-note 4 {{'d' declared here}}
[d setObject:d forKey:@"key"]; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}}
@@ -199,7 +199,7 @@ void subclassingNSMutableDictionary() {
d[@"key"] = d; // expected-warning {{adding 'd' to 'd' might cause circular dependency in container}}
}
-void subclassingNSMutableSet() {
+void subclassingNSMutableSet(void) {
FootableSet *s = nil; // expected-note {{'s' declared here}}
[s addObject:s]; // expected-warning {{adding 's' to 's' might cause circular dependency in container}}
diff --git a/clang/test/SemaObjC/class-message-protocol-lookup.m b/clang/test/SemaObjC/class-message-protocol-lookup.m
index d9f954dc473d4..a939707d5276e 100644
--- a/clang/test/SemaObjC/class-message-protocol-lookup.m
+++ b/clang/test/SemaObjC/class-message-protocol-lookup.m
@@ -25,7 +25,7 @@ - (void) Meth {
+ (id)alloc { return 0; }
@end
-int main ()
+int main (void)
{
Class<TestProtocol> c = [c alloc]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}}
Class<Test2Protocol> c1 = [c1 alloc2]; // expected-warning {{instance method 'alloc2' found instead of class method 'alloc2'}}
diff --git a/clang/test/SemaObjC/class-property-access.m b/clang/test/SemaObjC/class-property-access.m
index d57b986c3eac6..73f9d308d5f09 100644
--- a/clang/test/SemaObjC/class-property-access.m
+++ b/clang/test/SemaObjC/class-property-access.m
@@ -6,7 +6,7 @@ + (Test*)one;
- (int)two;
@end
-int main ()
+int main (void)
{
return Test.one.two;
}
@@ -24,7 +24,7 @@ +(int)classMethod;
@end
@interface Subclass : RootClass @end
-void Test1() {
+void Test1(void) {
// now okay
(void)RootClass.property;
(void)Subclass.property;
diff --git a/clang/test/SemaObjC/class-stub-attr.m b/clang/test/SemaObjC/class-stub-attr.m
index 46c07d8b5f789..97a81038b6c8b 100644
--- a/clang/test/SemaObjC/class-stub-attr.m
+++ b/clang/test/SemaObjC/class-stub-attr.m
@@ -24,4 +24,4 @@ @interface InvalidClassStubAttribute : NSObject
@end
__attribute__((objc_class_stub)) // expected-error {{'objc_class_stub' attribute only applies to Objective-C interfaces}}
-int cannotHaveObjCClassStubAttribute() {}
+int cannotHaveObjCClassStubAttribute(void) {}
diff --git a/clang/test/SemaObjC/class-unavail-warning.m b/clang/test/SemaObjC/class-unavail-warning.m
index 30ebf7939edf4..fa99269daf5aa 100644
--- a/clang/test/SemaObjC/class-unavail-warning.m
+++ b/clang/test/SemaObjC/class-unavail-warning.m
@@ -31,7 +31,7 @@ @interface MyClass (Cat2) // no error.
@implementation MyClass (Cat2) // no error.
@end
-int main() {
+int main(void) {
[MyClass new]; // expected-error {{'MyClass' is unavailable: not available}}
[MyClass self]; // expected-error {{'MyClass' is unavailable: not available}}
[MyClass addObject:((void *)0)]; // expected-error {{'MyClass' is unavailable: not available}}
@@ -64,7 +64,7 @@ - (void) applicationDidFinishLaunching
@class Foo;
@class Foo;
@class Foo;
-Foo * f_func() { // expected-error {{'Foo' is unavailable}}
+Foo * f_func(void) { // expected-error {{'Foo' is unavailable}}
return 0;
}
diff --git a/clang/test/SemaObjC/compare-qualified-class.m b/clang/test/SemaObjC/compare-qualified-class.m
index c7d4a2ec1a398..e9df28209f00d 100644
--- a/clang/test/SemaObjC/compare-qualified-class.m
+++ b/clang/test/SemaObjC/compare-qualified-class.m
@@ -10,7 +10,7 @@ @protocol SomeProtocol1
@interface SomeObject <SomeProtocol>
@end
-int main () {
+int main (void) {
Class <SomeProtocol> classA;
Class <SomeProtocol> classB;
Class <SomeProtocol, SomeProtocol1> classC;
diff --git a/clang/test/SemaObjC/compound-init.m b/clang/test/SemaObjC/compound-init.m
index 7b288bb3de2dd..ebd0617f1e015 100644
--- a/clang/test/SemaObjC/compound-init.m
+++ b/clang/test/SemaObjC/compound-init.m
@@ -2,6 +2,6 @@
@interface A
@end
-void f() {
+void f(void) {
(A){ 0 }; // expected-error{{cannot initialize Objective-C class type 'A'}}
}
diff --git a/clang/test/SemaObjC/comptypes-1.m b/clang/test/SemaObjC/comptypes-1.m
index 67b73ce0f8a78..a18ebd13ce1b6 100644
--- a/clang/test/SemaObjC/comptypes-1.m
+++ b/clang/test/SemaObjC/comptypes-1.m
@@ -2,7 +2,7 @@
#define nil (void *)0;
-extern void foo();
+extern void foo(void);
@protocol MyProtocol
- (void) foo;
@@ -16,7 +16,7 @@ @interface MyOtherClass <MyProtocol>
- (void) foo;
@end
-int main()
+int main(void)
{
id obj = nil;
id<MyProtocol> obj_p = nil;
diff --git a/clang/test/SemaObjC/comptypes-2.m b/clang/test/SemaObjC/comptypes-2.m
index 8e90455de6642..3589eba883a08 100644
--- a/clang/test/SemaObjC/comptypes-2.m
+++ b/clang/test/SemaObjC/comptypes-2.m
@@ -11,7 +11,7 @@ - (void) foo;
@interface MyClass
@end
-int main()
+int main(void)
{
id obj = nil;
id<MyProtocol> obj_p = nil;
diff --git a/clang/test/SemaObjC/comptypes-3.m b/clang/test/SemaObjC/comptypes-3.m
index 6c1ce419b621e..bb24328f27add 100644
--- a/clang/test/SemaObjC/comptypes-3.m
+++ b/clang/test/SemaObjC/comptypes-3.m
@@ -2,7 +2,7 @@
#define nil (void *)0;
-extern void foo();
+extern void foo(void);
@protocol MyProtocolA
- (void) methodA;
@@ -19,7 +19,7 @@ @protocol MyProtocolAC <MyProtocolA>
- (void) methodC;
@end
-int main()
+int main(void)
{
id<MyProtocolA> obj_a = nil;
id<MyProtocolB> obj_b = nil;
diff --git a/clang/test/SemaObjC/comptypes-4.m b/clang/test/SemaObjC/comptypes-4.m
index adc324c91ee5c..f1c2e54570c74 100644
--- a/clang/test/SemaObjC/comptypes-4.m
+++ b/clang/test/SemaObjC/comptypes-4.m
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-extern void foo();
+extern void foo(void);
@protocol MyProtocol @end
@interface MyClass @end
-int main()
+int main(void)
{
MyClass <MyProtocol> *obj_p;
MyClass *obj_cp;
diff --git a/clang/test/SemaObjC/comptypes-5.m b/clang/test/SemaObjC/comptypes-5.m
index 46300e3a5309e..4b50684938c9b 100644
--- a/clang/test/SemaObjC/comptypes-5.m
+++ b/clang/test/SemaObjC/comptypes-5.m
@@ -2,7 +2,7 @@
#define nil (void *)0;
-extern void foo();
+extern void foo(void);
@protocol MyProtocol
- (void) method;
@@ -18,7 +18,7 @@ - (void) method;
@interface MyOtherClass : MyClass
@end
-int main()
+int main(void)
{
id <MyProtocol> obj_id_p = nil;
MyClass *obj_c_cat_p = nil;
diff --git a/clang/test/SemaObjC/comptypes-7.m b/clang/test/SemaObjC/comptypes-7.m
index 4623cfd6922d2..fa836ce72b885 100644
--- a/clang/test/SemaObjC/comptypes-7.m
+++ b/clang/test/SemaObjC/comptypes-7.m
@@ -2,7 +2,7 @@
#define nil (void *)0;
-extern void foo();
+extern void foo(void);
@protocol MyProtocol
- (void) method;
@@ -11,7 +11,7 @@ - (void) method;
@interface MyClass
@end
-int main()
+int main(void)
{
id obj = nil;
id <MyProtocol> obj_p = nil;
diff --git a/clang/test/SemaObjC/comptypes-8.m b/clang/test/SemaObjC/comptypes-8.m
index e651030689113..8bb99a189e9d2 100644
--- a/clang/test/SemaObjC/comptypes-8.m
+++ b/clang/test/SemaObjC/comptypes-8.m
@@ -6,7 +6,7 @@ @protocol MyProtocol
id<MyProtocol> obj_p = 0;
-int main()
+int main(void)
{
obj_p = 0;
}
diff --git a/clang/test/SemaObjC/comptypes-legal.m b/clang/test/SemaObjC/comptypes-legal.m
index 57b040c613219..58641b1e14aff 100644
--- a/clang/test/SemaObjC/comptypes-legal.m
+++ b/clang/test/SemaObjC/comptypes-legal.m
@@ -11,7 +11,7 @@ void __setRetained(id *ivar, id value, NSObject **o) {
*ivar = value;
}
static NSString *_logProcessPrefix = 0;
-void func() {
+void func(void) {
__setRetained(&_logProcessPrefix, _logProcessPrefix, &_logProcessPrefix);
}
@implementation NSObject (ScopeAdditions)
diff --git a/clang/test/SemaObjC/debugger-cast-result-to-id.m b/clang/test/SemaObjC/debugger-cast-result-to-id.m
index ecf3e74ba79f5..c3c072a0042b0 100644
--- a/clang/test/SemaObjC/debugger-cast-result-to-id.m
+++ b/clang/test/SemaObjC/debugger-cast-result-to-id.m
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s
extern __unknown_anytype test0;
-extern __unknown_anytype test1();
+extern __unknown_anytype test1(void);
-void test_unknown_anytype_receiver() {
+void test_unknown_anytype_receiver(void) {
(void)(int)[[test0 unknownMethod] otherUnknownMethod];;
(void)(id)[[test1() unknownMethod] otherUnknownMethod];
id x = test0;
@@ -13,6 +13,6 @@ void test_unknown_anytype_receiver() {
// rdar://10988847
@class NSString; // expected-note {{forward declaration of class here}}
-void rdar10988847() {
+void rdar10988847(void) {
id s = [NSString stringWithUTF8String:"foo"]; // expected-warning {{receiver 'NSString' is a forward class and corresponding @interface may not exist}}
}
diff --git a/clang/test/SemaObjC/delay-parsing-cfunctions.m b/clang/test/SemaObjC/delay-parsing-cfunctions.m
index c74b054f74d4a..bd578bf2555db 100644
--- a/clang/test/SemaObjC/delay-parsing-cfunctions.m
+++ b/clang/test/SemaObjC/delay-parsing-cfunctions.m
@@ -37,7 +37,7 @@ - (void)privateMethod1 {
static int getMe;
-static int test() {
+static int test(void) {
return 0;
}
diff --git a/clang/test/SemaObjC/deprecate_function_containers.m b/clang/test/SemaObjC/deprecate_function_containers.m
index 531cf11d27042..f8aa10b703bf1 100644
--- a/clang/test/SemaObjC/deprecate_function_containers.m
+++ b/clang/test/SemaObjC/deprecate_function_containers.m
@@ -2,26 +2,26 @@
// rdar://10414277
@protocol P
-void p_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
+void p_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
@end
@interface I
-void foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
-inline void v_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
-static int s_foo() {return 0; } // expected-warning {{function definition inside an Objective-C container is deprecated}}
-static inline int si_val() { return 1; } // expected-warning {{function definition inside an Objective-C container is deprecated}}
+void foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
+inline void v_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
+static int s_foo(void) {return 0; } // expected-warning {{function definition inside an Objective-C container is deprecated}}
+static inline int si_val(void) { return 1; } // expected-warning {{function definition inside an Objective-C container is deprecated}}
@end
@interface I(CAT)
-void cat_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
+void cat_foo(void) {} // expected-warning {{function definition inside an Objective-C container is deprecated}}
@end
@implementation I
-inline void v_imp_foo() {}
+inline void v_imp_foo(void) {}
@end
@implementation I(CAT)
-void cat_imp_foo() {}
+void cat_imp_foo(void) {}
@end
// rdar://16859666
diff --git a/clang/test/SemaObjC/deprecated-objc-introspection.m b/clang/test/SemaObjC/deprecated-objc-introspection.m
index 4f7484145865d..e80a330e320d4 100644
--- a/clang/test/SemaObjC/deprecated-objc-introspection.m
+++ b/clang/test/SemaObjC/deprecated-objc-introspection.m
@@ -21,7 +21,7 @@ @interface Whatever : NSObject
-(id)foo;
@end
-static void func() {
+static void func(void) {
id x;
diff --git a/clang/test/SemaObjC/dictionary-literal-duplicates.m b/clang/test/SemaObjC/dictionary-literal-duplicates.m
index 5bfe66d280fe2..2b31c0c8b3f72 100644
--- a/clang/test/SemaObjC/dictionary-literal-duplicates.m
+++ b/clang/test/SemaObjC/dictionary-literal-duplicates.m
@@ -23,7 +23,7 @@ + (instancetype)dictionaryWithObjects:(const id[])objects
count:(unsigned long)cnt;
@end
-void test() {
+void test(void) {
NSDictionary *t1 = @{
@"foo" : @0, // expected-note 2 {{previous equal key is here}}
@"foo" : @0, // expected-warning{{duplicate key in dictionary literal}}
diff --git a/clang/test/SemaObjC/dllexport.m b/clang/test/SemaObjC/dllexport.m
index 11cd1fbe14e6e..b306fae527c87 100644
--- a/clang/test/SemaObjC/dllexport.m
+++ b/clang/test/SemaObjC/dllexport.m
@@ -6,7 +6,7 @@
// expected-warning at -1{{'dllexport' attribute only applies to}}
typedef int __declspec(dllexport) typedef3;
// expected-warning at -1{{'dllexport' attribute only applies to}}
-typedef __declspec(dllexport) void (*FunTy)();
+typedef __declspec(dllexport) void (*FunTy)(void);
// expected-warning at -1{{'dllexport' attribute only applies to}}
enum __declspec(dllexport) E { Val };
// expected-warning at -1{{'dllexport' attribute only applies to}}
diff --git a/clang/test/SemaObjC/dllimport.m b/clang/test/SemaObjC/dllimport.m
index ea87aea9b8da2..ddc04d309a167 100644
--- a/clang/test/SemaObjC/dllimport.m
+++ b/clang/test/SemaObjC/dllimport.m
@@ -6,7 +6,7 @@
// expected-warning at -1{{'dllimport' attribute only applies to}}
typedef int __declspec(dllimport) typedef3;
// expected-warning at -1{{'dllimport' attribute only applies to}}
-typedef __declspec(dllimport) void (*FunTy)();
+typedef __declspec(dllimport) void (*FunTy)(void);
// expected-warning at -1{{'dllimport' attribute only applies to}}
enum __declspec(dllimport) E { Val };
// expected-warning at -1{{'dllimport' attribute only applies to}}
diff --git a/clang/test/SemaObjC/encode-typeof-test.m b/clang/test/SemaObjC/encode-typeof-test.m
index fe8f29c3b9723..d63164dc9804b 100644
--- a/clang/test/SemaObjC/encode-typeof-test.m
+++ b/clang/test/SemaObjC/encode-typeof-test.m
@@ -19,7 +19,7 @@ @interface Intf <Proto>
@implementation Intf
@end
-int main()
+int main(void)
{
int i;
typeof(@encode(typeof(i))) e = @encode(typeof(Intf)); // expected-warning {{initializer-string for char array is too long}}
@@ -39,7 +39,7 @@ int main()
char *string;
};
-const char *RetEncode () {
+const char *RetEncode (void) {
return @encode(struct foo); // expected-warning {{encoding of 'struct foo' type is incomplete because 'short8' (vector of 8 'short' values) component has unknown encoding}}
}
diff --git a/clang/test/SemaObjC/enum-fixed-type.m b/clang/test/SemaObjC/enum-fixed-type.m
index 42308b75ca9a1..987eb85f33d3a 100644
--- a/clang/test/SemaObjC/enum-fixed-type.m
+++ b/clang/test/SemaObjC/enum-fixed-type.m
@@ -28,7 +28,7 @@
enum : Integer { Blah, Blarg } field4 : 4;
};
-void test() {
+void test(void) {
long value = 2;
Enumeration e = value;
}
diff --git a/clang/test/SemaObjC/error-outof-scope-property-use.m b/clang/test/SemaObjC/error-outof-scope-property-use.m
index c480e2df0b7ee..3072347ab5e97 100644
--- a/clang/test/SemaObjC/error-outof-scope-property-use.m
+++ b/clang/test/SemaObjC/error-outof-scope-property-use.m
@@ -23,7 +23,7 @@ -(void)job
@end
void
-doLaunchdJobCPU()
+doLaunchdJobCPU(void)
{
[uuids_jobs enumerateKeysAndObjectsUsingBlock]; // expected-error {{use of undeclared identifier 'uuids_jobs'}}
}
diff --git a/clang/test/SemaObjC/exprs.m b/clang/test/SemaObjC/exprs.m
index b198cba4a9b1a..10ae20d62e919 100644
--- a/clang/test/SemaObjC/exprs.m
+++ b/clang/test/SemaObjC/exprs.m
@@ -7,7 +7,7 @@ Class test1(Class X) {
// rdar://6079877
-void test2() {
+void test2(void) {
id str = @"foo"
"bar\0" // no-warning
@"baz" " blarg";
@@ -36,7 +36,7 @@ void test3(Object *o) {
@class Incomplete_ObjC_class; // expected-note{{forward declaration of class here}}
struct Incomplete_struct; // expected-note {{forward declaration}}
-void test_encode() {
+void test_encode(void) {
(void)@encode(Incomplete_ObjC_class); // expected-error {{incomplete type}}
(void)@encode(struct Incomplete_struct); // expected-error {{incomplete type}}
(void)@encode(Incomplete_ObjC_class*);
diff --git a/clang/test/SemaObjC/externally-retained.m b/clang/test/SemaObjC/externally-retained.m
index f9fbdb0689443..6d983f4e423bc 100644
--- a/clang/test/SemaObjC/externally-retained.m
+++ b/clang/test/SemaObjC/externally-retained.m
@@ -6,12 +6,12 @@
@interface ObjCTy
@end
-void test1() {
+void test1(void) {
EXT_RET int a; // expected-warning{{'objc_externally_retained' can only be applied to}}
EXT_RET __weak ObjCTy *b; // expected-warning{{'objc_externally_retained' can only be applied to}}
- EXT_RET __weak int (^c)(); // expected-warning{{'objc_externally_retained' can only be applied to}}
+ EXT_RET __weak int (^c)(void); // expected-warning{{'objc_externally_retained' can only be applied to}}
- EXT_RET int (^d)() = ^{return 0;};
+ EXT_RET int (^d)(void) = ^{return 0;};
EXT_RET ObjCTy *e = 0;
EXT_RET __strong ObjCTy *f = 0;
@@ -37,7 +37,7 @@ -(void)m: (ObjCTy *) p EXT_RET {
}
@end
-void test4() {
+void test4(void) {
__attribute__((objc_externally_retained(0))) ObjCTy *a; // expected-error{{'objc_externally_retained' attribute takes no arguments}}
}
diff --git a/clang/test/SemaObjC/foreach.m b/clang/test/SemaObjC/foreach.m
index 06800dd12bde3..e90f28aa1a12b 100644
--- a/clang/test/SemaObjC/foreach.m
+++ b/clang/test/SemaObjC/foreach.m
@@ -38,7 +38,7 @@ - (unsigned long)countByEnumeratingWithState:(NSFastEnumerationState *)state obj
@end
-int main ()
+int main (void)
{
NSObject<NSFastEnumeration>* collection = ((void*)0);
for (id thing in collection) { } /* expected-warning {{unused variable 'thing'}} */
@@ -56,7 +56,7 @@ void test2(NSObject<NSFastEnumeration> *collection) {
}
}
-int cond();
+int cond(void);
void test3(NSObject<NSFastEnumeration> *a0, NSObject<NSFastEnumeration> *a1) {
for (id i in a0) { /* expected-note 2 {{jump enters Objective-C fast enumeration loop}} */
diff --git a/clang/test/SemaObjC/format-cstrings-warning.m b/clang/test/SemaObjC/format-cstrings-warning.m
index 28fa7ce0dcd8c..421c23b575ad6 100644
--- a/clang/test/SemaObjC/format-cstrings-warning.m
+++ b/clang/test/SemaObjC/format-cstrings-warning.m
@@ -70,7 +70,7 @@ void Test1(va_list argList) {
extern void MyCFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(__CFString__, 1, 2))); // expected-note {{'MyCFStringCreateWithFormat' declared here}}
extern void XMyNSLog(int, NSString *format, ...) __attribute__((format(__NSString__, 2, 3))); // expected-note {{'XMyNSLog' declared here}}
-void Test2() {
+void Test2(void) {
MyNSLog(@"%s\n", "Hello"); // expected-warning {{using %s directive in CFString which is being passed as a formatting argument to the formatting CFfunction}}
MyCFStringCreateWithFormat((CFStringRef)@"%s", "Hello"); // expected-warning {{using %s directive in CFString which is being passed as a formatting argument to the formatting CFfunction}}
diff --git a/clang/test/SemaObjC/format-ostrace-warning.m b/clang/test/SemaObjC/format-ostrace-warning.m
index c749881c7a8de..0177c85ecbc9f 100644
--- a/clang/test/SemaObjC/format-ostrace-warning.m
+++ b/clang/test/SemaObjC/format-ostrace-warning.m
@@ -41,7 +41,7 @@ void Test1(va_list argList) {
extern void XMyOSLog(int, const char* format, ...) __attribute__((format(os_trace, 2, 3)));
extern void os_trace(const char *format, ...) __attribute__((format(os_trace, 1, 2)));
-void Test2() {
+void Test2(void) {
MyOSLog("%s\n", "Hello");
MyFStringCreateWithFormat("%s", "Hello");
diff --git a/clang/test/SemaObjC/format-size-spec-nsinteger.m b/clang/test/SemaObjC/format-size-spec-nsinteger.m
index e7c0a0dd10111..8ecca6ec6a544 100644
--- a/clang/test/SemaObjC/format-size-spec-nsinteger.m
+++ b/clang/test/SemaObjC/format-size-spec-nsinteger.m
@@ -26,7 +26,7 @@
extern void NSLog(NSString *format, ...);
-void testSizeSpecifier() {
+void testSizeSpecifier(void) {
NSInteger i = 0;
NSUInteger j = 0;
NSLog(@"max NSInteger = %zi", i);
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m
index d80424487c6f2..6850ebfc5cb95 100644
--- a/clang/test/SemaObjC/format-strings-objc.m
+++ b/clang/test/SemaObjC/format-strings-objc.m
@@ -64,7 +64,7 @@ void check_nslog(unsigned k) {
extern void CFStringCreateWithFormat2(int *format, ...) __attribute__((format(CFString, 1, 2))); // expected-error {{format argument not a CFString}}
// <rdar://problem/7068334> - Catch use of long long with int arguments.
-void rdar_7068334() {
+void rdar_7068334(void) {
long long test = 500;
printf("%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
NSLog(@"%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
@@ -72,7 +72,7 @@ void rdar_7068334() {
}
// <rdar://problem/7697748>
-void rdar_7697748() {
+void rdar_7697748(void) {
NSLog(@"%@!"); // expected-warning{{more '%' conversions than data arguments}}
}
@@ -87,7 +87,7 @@ void test_p_conversion_with_objc_pointer(id x, id<Foo> y) {
extern void MyNSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
extern void MyCFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(__CFString__, 1, 2)));
-void check_mylog() {
+void check_mylog(void) {
MyNSLog(@"%@"); // expected-warning {{more '%' conversions than data arguments}}
MyCFStringCreateWithFormat(CFSTR("%@")); // expected-warning {{more '%' conversions than data arguments}}
}
@@ -98,7 +98,7 @@ + (id)fooWithFormat:(NSString *)fmt, ... __attribute__((format(__NSString__, 1,
+ (id)fooWithCStringFormat:(const char *)format, ... __attribute__((format(__printf__, 1, 2)));
@end
-void check_method() {
+void check_method(void) {
[Foo fooWithFormat:@"%@"]; // expected-warning {{more '%' conversions than data arguments}}
[Foo fooWithCStringFormat:"%@"]; // expected-warning {{invalid conversion specifier '@'}}
}
@@ -138,12 +138,12 @@ void rdar10743758(id x) {
#define MyNSLocalizedString(key) GetLocalizedString(key)
#define MyNSAssert(fmt, arg) NSLog(fmt, arg, 0, 0)
-void check_NSLocalizedString() {
+void check_NSLocalizedString(void) {
[Foo fooWithFormat:NSLocalizedString(@"format"), @"arg"]; // no-warning
[Foo fooWithFormat:MyNSLocalizedString(@"format"), @"arg"]; // expected-warning {{format string is not a string literal}}}
}
-void check_NSAssert() {
+void check_NSAssert(void) {
NSAssert(@"Hello %@", @"World"); // no-warning
MyNSAssert(@"Hello %@", @"World"); // expected-warning {{data argument not used by format string}}
}
@@ -153,7 +153,7 @@ void check_NSAssert() {
// Test that %S, %C, %ls check for 16 bit types in ObjC strings, as described at
// http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265
-void test_percent_S() {
+void test_percent_S(void) {
const unsigned short data[] = { 'a', 'b', 0 };
const unsigned short* ptr = data;
NSLog(@"%S", ptr); // no-warning
@@ -162,7 +162,7 @@ void test_percent_S() {
NSLog(@"%S", wchar_ptr); // expected-warning{{format specifies type 'const unichar *' (aka 'const unsigned short *') but the argument has type 'const wchar_t *'}}
}
-void test_percent_ls() {
+void test_percent_ls(void) {
const unsigned short data[] = { 'a', 'b', 0 };
const unsigned short* ptr = data;
NSLog(@"%ls", ptr); // no-warning
@@ -171,7 +171,7 @@ void test_percent_ls() {
NSLog(@"%ls", wchar_ptr); // expected-warning{{format specifies type 'const unichar *' (aka 'const unsigned short *') but the argument has type 'const wchar_t *'}}
}
-void test_percent_C() {
+void test_percent_C(void) {
const unsigned short data = 'a';
NSLog(@"%C", data); // no-warning
@@ -213,14 +213,14 @@ + (void)log2:(NSString *)fmt, ... {
// Test that it is okay to use %p with the address of a block.
-void rdar11049844_aux();
-int rdar11049844() {
+void rdar11049844_aux(void);
+int rdar11049844(void) {
typedef void (^MyBlock)(void);
- MyBlock x = ^void() { rdar11049844_aux(); };
+ MyBlock x = ^void(void) { rdar11049844_aux(); };
printf("%p", x); // no-warning
}
-void test_nonBuiltinCFStrings() {
+void test_nonBuiltinCFStrings(void) {
CFStringCreateWithFormat(__CFStringMakeConstantString("%@"), 1); // expected-warning{{format specifies type 'id' but the argument has type 'int'}}
}
@@ -256,13 +256,13 @@ void testTypeOf(NSInteger dW, NSInteger dH) {
NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}}
}
-void testUnicode() {
+void testUnicode(void) {
NSLog(@"%C", 0x2022); // no-warning
NSLog(@"%C", 0x202200); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
}
// Test Objective-C modifier flags.
-void testObjCModifierFlags() {
+void testObjCModifierFlags(void) {
NSLog(@"%[]@", @"Foo"); // expected-warning {{missing object format flag}}
NSLog(@"%[", @"Foo"); // expected-warning {{incomplete format specifier}}
NSLog(@"%[tt", @"Foo"); // expected-warning {{incomplete format specifier}}
diff --git a/clang/test/SemaObjC/gc-attributes.m b/clang/test/SemaObjC/gc-attributes.m
index 8bc5c6af33b69..1b81cafd35a7d 100644
--- a/clang/test/SemaObjC/gc-attributes.m
+++ b/clang/test/SemaObjC/gc-attributes.m
@@ -5,7 +5,7 @@ @interface A
void f0(__strong A**); // expected-note{{passing argument to parameter here}}
-void test_f0() {
+void test_f0(void) {
A *a;
static __weak A *a2;
f0(&a);
@@ -14,7 +14,7 @@ void test_f0() {
void f1(__weak A**); // expected-note{{passing argument to parameter here}}
-void test_f1() {
+void test_f1(void) {
A *a;
__strong A *a2;
f1(&a);
diff --git a/clang/test/SemaObjC/iboutlet.m b/clang/test/SemaObjC/iboutlet.m
index 1d8ec9965c2af..e7d8494c99355 100644
--- a/clang/test/SemaObjC/iboutlet.m
+++ b/clang/test/SemaObjC/iboutlet.m
@@ -45,7 +45,7 @@ @interface WeakOutlet
@property IBOutlet __weak WeakOutlet* WeakProp;
@end
-WeakOutlet* func() {
+WeakOutlet* func(void) {
__weak WeakOutlet* pwi;
pwi.WeakProp = (WeakOutlet*)0;
pwi.WeakProp = pwi.WeakProp;
diff --git a/clang/test/SemaObjC/id.m b/clang/test/SemaObjC/id.m
index ced406ebd29b8..a09f49a682795 100644
--- a/clang/test/SemaObjC/id.m
+++ b/clang/test/SemaObjC/id.m
@@ -5,7 +5,7 @@ @protocol Foo;
Class T;
id<Foo> S;
id R;
-void foo() {
+void foo(void) {
// Test assignment compatibility of Class and id. No warning should be
// produced.
// rdar://6770142 - Class and id<foo> are compatible.
diff --git a/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m b/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m
index 996664f6a9e09..1ed28c8191729 100644
--- a/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m
+++ b/clang/test/SemaObjC/ignore-qualifier-on-qualified-id.m
@@ -12,7 +12,7 @@ void takeId(id test) {}
void takeCopyableId(id<NSCopying> test) {}
-id<NSCopying> Test () {
+id<NSCopying> Test (void) {
NSString const *constantString = @"Test";
takeId(constantString);
takeCopyableId(constantString);
diff --git a/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m b/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m
index 23c7b96e3709e..3650f45d90be5 100644
--- a/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m
+++ b/clang/test/SemaObjC/illegal-nonarc-bridged-cast.m
@@ -8,15 +8,15 @@
@interface NSString
@end
-CFTypeRef CFCreateSomething();
-CFStringRef CFCreateString();
-CFTypeRef CFGetSomething();
-CFStringRef CFGetString();
+CFTypeRef CFCreateSomething(void);
+CFStringRef CFCreateString(void);
+CFTypeRef CFGetSomething(void);
+CFStringRef CFGetString(void);
-id CreateSomething();
-NSString *CreateNSString();
+id CreateSomething(void);
+NSString *CreateNSString(void);
-void from_cf() {
+void from_cf(void) {
id obj1 = (__bridge_transfer id)CFCreateSomething(); // expected-warning {{'__bridge_transfer' casts have no effect when not using ARC}}
id obj2 = (__bridge_transfer NSString*)CFCreateString(); // expected-warning {{'__bridge_transfer' casts have no effect when not using ARC}}
(__bridge int*)CFCreateSomething(); // expected-warning {{expression result unused}} expected-warning {{cast from 'const void *' to 'int *' drops const qualifier}}
@@ -31,7 +31,7 @@ void to_cf(id obj) {
CFStringRef cf4 = (__bridge CFStringRef)CreateNSString();
}
-void fixits() {
+void fixits(void) {
id obj1 = (id)CFCreateSomething();
CFTypeRef cf1 = (CFTypeRef)CreateSomething();
}
@@ -45,7 +45,7 @@ void to_cf_ignored(id obj) {
// Check that clang doesn't warn about dropping const from Objective-C object
// types.
-void test_wcast_qual() {
+void test_wcast_qual(void) {
CFStringRef c;
NSString *n0 = (NSString *)c;
NSString **n1 = (NSString **)&c;
diff --git a/clang/test/SemaObjC/infer-availability-from-init.m b/clang/test/SemaObjC/infer-availability-from-init.m
index 6719400a9f428..0c16708f20d05 100644
--- a/clang/test/SemaObjC/infer-availability-from-init.m
+++ b/clang/test/SemaObjC/infer-availability-from-init.m
@@ -10,7 +10,7 @@ @interface MyObject : NSObject
-(instancetype)init __attribute__((unavailable)); // expected-note{{'init' has been explicitly marked unavailable here}}
@end
-void usemyobject() {
+void usemyobject(void) {
[MyObject new]; // expected-error{{'new' is unavailable}}
}
@@ -19,7 +19,7 @@ +(instancetype)init __attribute__((unavailable));
+(instancetype)new;
@end
-void usemyotherobject() {
+void usemyotherobject(void) {
[MyOtherObject new]; // no error; new is overrideen.
}
@@ -29,7 +29,7 @@ -(instancetype)new;
+(instancetype)new: (int)x;
@end
-void usenotgoodoverride() {
+void usenotgoodoverride(void) {
[NotGoodOverride new]; // no error
}
@@ -42,7 +42,7 @@ @interface NotMyObject : NotNSObject
-(instancetype)init __attribute__((unavailable));
@end
-void usenotmyobject() {
+void usenotmyobject(void) {
[NotMyObject new]; // no error; this isn't NSObject
}
diff --git a/clang/test/SemaObjC/instancetype.m b/clang/test/SemaObjC/instancetype.m
index 59a67247a35cd..3e383eff8ab6b 100644
--- a/clang/test/SemaObjC/instancetype.m
+++ b/clang/test/SemaObjC/instancetype.m
@@ -37,13 +37,13 @@ - (void)methodOnSubclass2;
@end
// Check the basic initialization pattern.
-void test_instancetype_alloc_init_simple() {
+void test_instancetype_alloc_init_simple(void) {
Root *r1 = [[Root alloc] init];
Subclass1 *sc1 = [[Subclass1 alloc] init];
}
// Test that message sends to instancetype methods have the right type.
-void test_instancetype_narrow_method_search() {
+void test_instancetype_narrow_method_search(void) {
// instancetype on class methods
Subclass1 *sc1 = [[Subclass1 alloc] initSubclass2]; // expected-warning{{'Subclass1' may not respond to 'initSubclass2'}}
Subclass2 *sc2 = [[Subclass2 alloc] initSubclass2]; // okay
@@ -156,7 +156,7 @@ - (Subclass4 *)initOther { return 0; }
// Check that inherited related return types influence the types of
// message sends.
-void test_instancetype_inherited() {
+void test_instancetype_inherited(void) {
[[Subclass4 alloc] initSubclass1]; // expected-warning{{'Subclass4' may not respond to 'initSubclass1'}}
[[Subclass4 alloc] initOther];
}
diff --git a/clang/test/SemaObjC/interface-1.m b/clang/test/SemaObjC/interface-1.m
index 0e47fa08bd77a..164327096fe40 100644
--- a/clang/test/SemaObjC/interface-1.m
+++ b/clang/test/SemaObjC/interface-1.m
@@ -19,7 +19,7 @@ @interface A
@interface INT1
@end
-void test2() {
+void test2(void) {
// rdar://6827200
INT1 b[3]; // expected-error {{array of interface 'INT1' is invalid (probably should be an array of pointers)}}
INT1 *c = &b[0];
diff --git a/clang/test/SemaObjC/invalid-code.m b/clang/test/SemaObjC/invalid-code.m
index 290f9d5192236..dc15d4ac2d420 100644
--- a/clang/test/SemaObjC/invalid-code.m
+++ b/clang/test/SemaObjC/invalid-code.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Wno-objc-root-class %s
// rdar://6124613
-void test1() {
+void test1(void) {
void *xyzzy = 0;
void *p = @xyzzy; // expected-error {{unexpected '@' in program}}
}
@@ -16,7 +16,7 @@ - (id) rdar_7495713 {
// <rdar://problem/7881045>
// This previously triggered a crash because a ';' was expected after the @throw statement.
-void foo() {
+void foo(void) {
@throw (id)0 // expected-error{{expected ';' after @throw}}
}
diff --git a/clang/test/SemaObjC/invalid-receiver.m b/clang/test/SemaObjC/invalid-receiver.m
index 1174dd2e1706d..1742993e4dcb0 100644
--- a/clang/test/SemaObjC/invalid-receiver.m
+++ b/clang/test/SemaObjC/invalid-receiver.m
@@ -4,6 +4,6 @@
int a, b;
} NotAClass;
-void foo() {
+void foo(void) {
[NotAClass nonexistent_method]; // expected-error {{receiver type 'NotAClass' (aka 'struct NotAClass') is not an Objective-C class}}
}
diff --git a/clang/test/SemaObjC/ivar-sem-check-1.m b/clang/test/SemaObjC/ivar-sem-check-1.m
index 9e28a380afbc6..0a9971a451fb5 100644
--- a/clang/test/SemaObjC/ivar-sem-check-1.m
+++ b/clang/test/SemaObjC/ivar-sem-check-1.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct S; // expected-note{{forward declaration of 'struct S'}}
-typedef int FOO();
+typedef int FOO(void);
@interface INTF
{
diff --git a/clang/test/SemaObjC/kindof.m b/clang/test/SemaObjC/kindof.m
index b2c3205182070..1462814e36984 100644
--- a/clang/test/SemaObjC/kindof.m
+++ b/clang/test/SemaObjC/kindof.m
@@ -316,7 +316,7 @@ @interface A : NSObject
@interface B : NSObject
@property (getter=isActive, readonly) BOOL active;
@end
-void foo() {
+void foo(void) {
__kindof B *NSApp;
if ([NSApp isActive]) {
}
@@ -365,9 +365,9 @@ void implicit_convert_array(NSArray<__kindof NSString *> *kindofStringsArray,
// __kindof + nullability
// ---------------------------------------------------------------------------
-void testNullability() {
+void testNullability(void) {
// The base type being a pointer type tickles the bug.
- extern __kindof id <NSCopying> _Nonnull getSomeCopyable();
+ extern __kindof id <NSCopying> _Nonnull getSomeCopyable(void);
NSString *string = getSomeCopyable(); // no-warning
void processCopyable(__typeof(getSomeCopyable()) string);
@@ -416,7 +416,7 @@ void testGeneric(NSGeneric<NSString*> *generic) {
[generic test:NSString_str];
}
-void testGenericAssignment() {
+void testGenericAssignment(void) {
NSMutableString *NSMutableString_str;
NSNumber *NSNumber_obj;
@@ -446,7 +446,7 @@ void testGenericAssignment() {
NSNumber_obj = typedef_generic.kindof_object; // expected-warning{{incompatible pointer types assigning to 'NSNumber *' from '__kindof Typedef_NSString'}}
}
-void testKindofNonObjectType() {
+void testKindofNonObjectType(void) {
typedef void (^BlockType)(int);
NSGeneric<BlockType> *generic;
}
diff --git a/clang/test/SemaObjC/legacy-implementation-1.m b/clang/test/SemaObjC/legacy-implementation-1.m
index 2e4c5ae06106d..38c06ec18be0e 100644
--- a/clang/test/SemaObjC/legacy-implementation-1.m
+++ b/clang/test/SemaObjC/legacy-implementation-1.m
@@ -5,7 +5,7 @@ @implementation INTF // expected-warning {{cannot find interface declaration for
INTF* pi;
-INTF* FUNC()
+INTF* FUNC(void)
{
return pi;
}
diff --git a/clang/test/SemaObjC/message.m b/clang/test/SemaObjC/message.m
index 2c4d8066f6041..ae4bfb39c0ac1 100644
--- a/clang/test/SemaObjC/message.m
+++ b/clang/test/SemaObjC/message.m
@@ -74,7 +74,7 @@ int f0(I0 *ob) {
[ ob nonVararg: 0, 1, 2]; // expected-error {{too many arguments to method call}}
}
-int f2() {
+int f2(void) {
const id foo;
[foo bar]; // expected-warning {{method '-bar' not found (return type defaults to 'id')}}
return 0;
@@ -92,7 +92,7 @@ int test5(int X) {
}
// PR4021
-void foo4() {
+void foo4(void) {
struct objc_object X[10];
[X rect]; // expected-warning {{receiver type 'struct objc_object *' is not 'id' or interface pointer, consider casting it to 'id'}}
diff --git a/clang/test/SemaObjC/method-arg-qualifier-warning.m b/clang/test/SemaObjC/method-arg-qualifier-warning.m
index 690509e795e52..c198786e461ca 100644
--- a/clang/test/SemaObjC/method-arg-qualifier-warning.m
+++ b/clang/test/SemaObjC/method-arg-qualifier-warning.m
@@ -10,7 +10,7 @@ - (BOOL)isEqualToString:(NSString *)aString; // expected-note 2{{passing argumen
static NSString const * Identifier2 = @"Identifier2";
static NSString * const Identifier3 = @"Identifier3";
-int main () {
+int main (void) {
[@"Identifier1" isEqualToString:Identifier1]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}}
[@"Identifier2" isEqualToString:Identifier2]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}}
diff --git a/clang/test/SemaObjC/method-bad-param.m b/clang/test/SemaObjC/method-bad-param.m
index f70f2cf853e51..6193136bf3e7a 100644
--- a/clang/test/SemaObjC/method-bad-param.m
+++ b/clang/test/SemaObjC/method-bad-param.m
@@ -27,7 +27,7 @@ void func_with_bad_call(bar* b, foo* f) {
}
void somefunc(foo x) {} // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
-foo somefunc2() {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
+foo somefunc2(void) {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
// rdar://6780761
void f0(foo *a0) {
@@ -50,7 +50,7 @@ - (void)crashMe:(enum bogus)p { // expected-error {{variable has incomplete type
@interface arrayfun
- (int[6])arrayRet; // expected-error {{function cannot return array type 'int[6]'}}
-- (int())funcRet; // expected-error {{function cannot return function type 'int ()'}}
+- (int(void))funcRet; // expected-error {{function cannot return function type 'int (void)'}}
@end
@interface qux
diff --git a/clang/test/SemaObjC/method-not-defined.m b/clang/test/SemaObjC/method-not-defined.m
index 792469b719c68..e63839956ad24 100644
--- a/clang/test/SemaObjC/method-not-defined.m
+++ b/clang/test/SemaObjC/method-not-defined.m
@@ -3,7 +3,7 @@
@interface Foo // expected-note {{receiver is instance of class declared here}}
@end
-void test() {
+void test(void) {
Foo *fooObj;
id obj;
diff --git a/clang/test/SemaObjC/method-sentinel-attr.m b/clang/test/SemaObjC/method-sentinel-attr.m
index 82ee373c2feff..12e0e4c80d6fc 100644
--- a/clang/test/SemaObjC/method-sentinel-attr.m
+++ b/clang/test/SemaObjC/method-sentinel-attr.m
@@ -23,7 +23,7 @@ - (id) foo15 : (id*)firstObj, ... __attribute__((sentinel(0,1)));
- (id) foo16 : (id**)firstObj, ... __attribute__((sentinel(0,1)));
@end
-int main ()
+int main (void)
{
INTF *p;
diff --git a/clang/test/SemaObjC/mrc-weak.m b/clang/test/SemaObjC/mrc-weak.m
index e5f407c9d84da..07dd92f7bc2ed 100644
--- a/clang/test/SemaObjC/mrc-weak.m
+++ b/clang/test/SemaObjC/mrc-weak.m
@@ -41,7 +41,7 @@ @implementation A {
@synthesize sd = _sd;
@end
-void test_goto() {
+void test_goto(void) {
goto after; // expected-error {{cannot jump from this goto statement to its label}}
__weak id x; // expected-note {{jump bypasses initialization of __weak variable}}}
after:
diff --git a/clang/test/SemaObjC/no-objc-exceptions.m b/clang/test/SemaObjC/no-objc-exceptions.m
index d47f51a84ebf3..d323ca3bcf8e9 100644
--- a/clang/test/SemaObjC/no-objc-exceptions.m
+++ b/clang/test/SemaObjC/no-objc-exceptions.m
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void f() {
+void f(void) {
@throw @"Hello"; // expected-error {{cannot use '@throw' with Objective-C exceptions disabled}}
}
-void g() {
+void g(void) {
@try { // expected-error {{cannot use '@try' with Objective-C exceptions disabled}}
f();
} @finally {
diff --git a/clang/test/SemaObjC/ns_returns_retained_block_return.m b/clang/test/SemaObjC/ns_returns_retained_block_return.m
index e5a96ca8af185..d3c9b7b2198e6 100644
--- a/clang/test/SemaObjC/ns_returns_retained_block_return.m
+++ b/clang/test/SemaObjC/ns_returns_retained_block_return.m
@@ -5,18 +5,18 @@
// expected-no-diagnostics
// rdar://17259812
-typedef void (^BT) ();
+typedef void (^BT) (void);
-BT foo() __attribute__((ns_returns_retained));
+BT foo(void) __attribute__((ns_returns_retained));
@interface I
-BT foo() __attribute__((ns_returns_retained));
+BT foo(void) __attribute__((ns_returns_retained));
- (BT) Meth __attribute__((ns_returns_retained));
+ (BT) ClsMeth __attribute__((ns_returns_retained));
@end
@implementation I
-BT foo() __attribute__((ns_returns_retained)) {return ^{}; }
+BT foo(void) __attribute__((ns_returns_retained)) {return ^{}; }
- (BT) Meth {return ^{}; }
+ (BT) ClsMeth {return ^{}; }
@end
diff --git a/clang/test/SemaObjC/nsobject-attribute.m b/clang/test/SemaObjC/nsobject-attribute.m
index 7c8d75d531e09..b013c9d265e74 100644
--- a/clang/test/SemaObjC/nsobject-attribute.m
+++ b/clang/test/SemaObjC/nsobject-attribute.m
@@ -55,7 +55,7 @@ @interface I
// <rdar://problem/10930507>
@property (nonatomic, retain) __attribute__((NSObject)) CGColorRefNoNSObject color; // // no-warning
@end
-void test_10453342() {
+void test_10453342(void) {
char* __attribute__((NSObject)) string2 = 0; // expected-warning {{'NSObject' attribute may be put on a typedef only; attribute is ignored}}
}
diff --git a/clang/test/SemaObjC/nullability.m b/clang/test/SemaObjC/nullability.m
index 3817289a79908..d8ec24f13ba9a 100644
--- a/clang/test/SemaObjC/nullability.m
+++ b/clang/test/SemaObjC/nullability.m
@@ -231,7 +231,7 @@ void testMultiProp(MultiProp *foo) {
ip = foo.e; // expected-error{{incompatible type 'MultiProp *(^ _Nullable)(int)'}}
}
-void testBlockLiterals() {
+void testBlockLiterals(void) {
(void)(^id(void) { return 0; });
(void)(^id _Nullable (void) { return 0; });
(void)(^ _Nullable id(void) { return 0; });
diff --git a/clang/test/SemaObjC/nullable-result.m b/clang/test/SemaObjC/nullable-result.m
index 9958531c2b7ae..6125141e8c261 100644
--- a/clang/test/SemaObjC/nullable-result.m
+++ b/clang/test/SemaObjC/nullable-result.m
@@ -15,7 +15,7 @@ void call(SomeClass *sc) {
[sc async_get:^(X *_Nullable rptr, NSError *err) {}];
}
-void test_conversion() {
+void test_conversion(void) {
X *_Nullable_result nr;
X *_Nonnull l = nr; // expected-warning{{implicit conversion from nullable pointer 'X * _Nullable_result' to non-nullable pointer type 'X * _Nonnull'}}
@@ -24,7 +24,7 @@ void test_conversion() {
};
}
-void test_dup() {
+void test_dup(void) {
id _Nullable_result _Nullable_result a; // expected-warning {{duplicate nullability specifier _Nullable_result}}
id _Nullable _Nullable_result b; // expected-error{{nullability specifier _Nullable_result conflicts with existing specifier '_Nullable'}}
id _Nullable_result _Nonnull c; // expected-error{{nullability specifier '_Nonnull' conflicts with existing specifier _Nullable_result}}
diff --git a/clang/test/SemaObjC/objc-array-literal.m b/clang/test/SemaObjC/objc-array-literal.m
index c0a0c67d442dd..9c9f6961ad933 100644
--- a/clang/test/SemaObjC/objc-array-literal.m
+++ b/clang/test/SemaObjC/objc-array-literal.m
@@ -9,14 +9,14 @@
typedef unsigned int NSUInteger;
#endif
-void checkNSArrayUnavailableDiagnostic() {
+void checkNSArrayUnavailableDiagnostic(void) {
id obj;
id arr = @[obj]; // expected-error {{definition of class NSArray must be available to use Objective-C array literals}}
}
@class NSArray; // expected-note {{forward declaration of class here}}
-void checkNSArrayFDDiagnostic() {
+void checkNSArrayFDDiagnostic(void) {
id obj;
id arr = @[obj]; // expected-error {{definition of class NSArray must be available to use Objective-C array literals}}
}
@@ -42,7 +42,7 @@ + (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
@end
-int main() {
+int main(void) {
NSArray *array = @[@"Hello", @"There", @"How Are You", [NSNumber numberWithInt:42]];
for (id string in array)
@@ -55,11 +55,11 @@ int main() {
}
// rdar://14303083
-id Test14303083() {
+id Test14303083(void) {
id obj = @[ @"A", (@"B" @"C")];
return @[ @"A", @"B" @"C"]; // expected-warning {{concatenated NSString literal for an NSArray expression - possibly missing a comma}}
}
-id radar15147688() {
+id radar15147688(void) {
#define R15147688_A @"hello"
#define R15147688_B "world"
#define CONCATSTR R15147688_A R15147688_B
@@ -69,7 +69,7 @@ id radar15147688() {
}
enum XXXYYYZZZType { XXXYYYZZZTypeAny }; // expected-note {{'XXXYYYZZZTypeAny' declared here}}
-void foo() {
+void foo(void) {
NSArray *array = @[
@(XXXYYYZZZTypeA), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeA'; did you mean 'XXXYYYZZZTypeAny'}}
@(XXXYYYZZZTypeSomethingSomething) // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeSomethingSomething'}}
diff --git a/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m b/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m
index f5ef55ef24392..73ef0168b4943 100644
--- a/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m
+++ b/clang/test/SemaObjC/objc-boxed-expressions-nsvalue.m
@@ -44,7 +44,7 @@
int dummy;
} BoxableUnion;
-void checkNSValueDiagnostic() {
+void checkNSValueDiagnostic(void) {
NSRect rect;
id value = @(rect); // expected-error{{definition of class NSValue must be available to use Objective-C boxed expressions}}
}
@@ -53,7 +53,7 @@ @interface NSValue
+ (NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type;
@end
-int main() {
+int main(void) {
NSPoint ns_point;
id ns_point_value = @(ns_point);
@@ -85,17 +85,17 @@ int main() {
id err = @(s); // expected-error{{illegal type 'SomeStruct' (aka 'struct _SomeStruct') used in a boxed expression}}
}
-CGRect getRect() {
+CGRect getRect(void) {
CGRect r;
return r;
}
-SomeStruct getSomeStruct() {
+SomeStruct getSomeStruct(void) {
SomeStruct s;
return s;
}
-void rvalue() {
+void rvalue(void) {
id rv_rect = @(getRect());
id rv_some_struct = @(getSomeStruct()); // expected-error {{illegal type 'SomeStruct' (aka 'struct _SomeStruct') used in a boxed expression}}
}
diff --git a/clang/test/SemaObjC/objc-buffered-methods.m b/clang/test/SemaObjC/objc-buffered-methods.m
index 55e489798d773..bd4162c682047 100644
--- a/clang/test/SemaObjC/objc-buffered-methods.m
+++ b/clang/test/SemaObjC/objc-buffered-methods.m
@@ -12,7 +12,7 @@ - (void) Meth;
@implementation I
+ (void) _defaultMinSize { };
-static void _initCommon() {
+static void _initCommon(void) {
Class graphicClass;
[graphicClass _defaultMinSize];
}
diff --git a/clang/test/SemaObjC/objc-class-property.m b/clang/test/SemaObjC/objc-class-property.m
index f8d49112766df..a7a4580cbff80 100644
--- a/clang/test/SemaObjC/objc-class-property.m
+++ b/clang/test/SemaObjC/objc-class-property.m
@@ -35,13 +35,13 @@ @implementation A // expected-warning {{class property 'c2' requires method 'c2'
@dynamic customGetterProperty;
@end
-int test() {
+int test(void) {
A *a = [[A alloc] init];
a.c; // expected-error {{property 'c' is a class property; did you mean to access it with class 'A'}}
return a.x + A.c;
}
-void customSelectors() {
+void customSelectors(void) {
A.customSetterProperty = 1;
(void)A.customGetterProperty;
}
diff --git a/clang/test/SemaObjC/objc-container-subscripting-1.m b/clang/test/SemaObjC/objc-container-subscripting-1.m
index b5ed5a68dd849..04713c9f7a24d 100644
--- a/clang/test/SemaObjC/objc-container-subscripting-1.m
+++ b/clang/test/SemaObjC/objc-container-subscripting-1.m
@@ -9,7 +9,7 @@ @interface NSMutableArray
@interface XNSMutableArray
@end
-int main() {
+int main(void) {
id array;
id oldObject = array[10]; // expected-warning {{instance method '-objectAtIndexedSubscript:' not found (return type defaults to 'id')}}
diff --git a/clang/test/SemaObjC/objc-container-subscripting-2.m b/clang/test/SemaObjC/objc-container-subscripting-2.m
index 6e7ee7c40e58d..7c066400a10e9 100644
--- a/clang/test/SemaObjC/objc-container-subscripting-2.m
+++ b/clang/test/SemaObjC/objc-container-subscripting-2.m
@@ -13,14 +13,14 @@ - (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)object forKeyedSubscript:(size_t)key;
@end
-id func() {
+id func(void) {
NSMutableArray *array;
float f;
array[f] = array; // expected-error {{indexing expression is invalid because subscript type 'float' is not an integral or Objective-C pointer type}}
return array[3.14]; // expected-error {{indexing expression is invalid because subscript type 'double' is not an integral or Objective-C pointer type}}
}
-void test_unused() {
+void test_unused(void) {
NSMutableArray *array;
array[10]; // expected-warning {{container access result unused - container access should not be used for side effects}}
diff --git a/clang/test/SemaObjC/objc-container-subscripting-3.m b/clang/test/SemaObjC/objc-container-subscripting-3.m
index 2f716d6f7911b..d276d9638a060 100644
--- a/clang/test/SemaObjC/objc-container-subscripting-3.m
+++ b/clang/test/SemaObjC/objc-container-subscripting-3.m
@@ -11,7 +11,7 @@ - (int)objectForKeyedSubscript:(id)key; // expected-note {{method 'objectForKeye
- (void)setObject:(int)object forKeyedSubscript:(id)key; // expected-note {{parameter of type 'int' is declared here}}
@end
-int main() {
+int main(void) {
Test *array;
int i = array[10]; // expected-error {{method for accessing array element must have Objective-C object return type instead of 'int'}}
array[2] = i; // expected-error {{cannot assign to this array because assigning method's 2nd parameter of type 'int' is not an Objective-C pointer type}}
diff --git a/clang/test/SemaObjC/objc-container-subscripting.m b/clang/test/SemaObjC/objc-container-subscripting.m
index 3bbd7d404bb53..ae5326eb19def 100644
--- a/clang/test/SemaObjC/objc-container-subscripting.m
+++ b/clang/test/SemaObjC/objc-container-subscripting.m
@@ -10,7 +10,7 @@ - (void)setObject:(id *)object atIndexedSubscript:(void *)index; // expected-not
@end
@interface I @end
-int main() {
+int main(void) {
NSMutableArray<P> * array;
id oldObject = array[10]; // expected-error {{method index parameter type 'double' is not integral type}}
array[3] = 0; // expected-error {{method index parameter type 'void *' is not integral type}} \
@@ -32,7 +32,7 @@ - (void)setObject:(void*)object forKeyedSubscript:(id*)key; // expected-note {{p
@end
@class NSString;
-void testDict() {
+void testDict(void) {
NSMutableDictionary *dictionary;
NSString *key;
id newObject, oldObject;
diff --git a/clang/test/SemaObjC/objc-cstyle-args-in-methods.m b/clang/test/SemaObjC/objc-cstyle-args-in-methods.m
index ebc7192f0f5af..86df8fdbf1f7a 100644
--- a/clang/test/SemaObjC/objc-cstyle-args-in-methods.m
+++ b/clang/test/SemaObjC/objc-cstyle-args-in-methods.m
@@ -11,7 +11,7 @@ - (id)bad:(id)one, id two, double three { return two; }
@end
-int main() {
+int main(void) {
Foo *foo;
[foo test:@"One", @"Two"];
[foo bad:@"One", @"Two"]; // expected-error {{too few arguments to method call}}
diff --git a/clang/test/SemaObjC/objc-dictionary-literal.m b/clang/test/SemaObjC/objc-dictionary-literal.m
index ce301a0c73aff..92edb059cab28 100644
--- a/clang/test/SemaObjC/objc-dictionary-literal.m
+++ b/clang/test/SemaObjC/objc-dictionary-literal.m
@@ -5,7 +5,7 @@
#define nil ((void *)0)
-void checkNSDictionaryUnavailableDiagnostic() {
+void checkNSDictionaryUnavailableDiagnostic(void) {
id key;
id value;
id dict = @{ key : value }; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}}
@@ -13,7 +13,7 @@ void checkNSDictionaryUnavailableDiagnostic() {
@class NSDictionary; // expected-note {{forward declaration of class here}}
-void checkNSDictionaryFDDiagnostic() {
+void checkNSDictionaryFDDiagnostic(void) {
id key;
id value;
id dic = @{ key : value }; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}}
@@ -43,7 +43,7 @@ - (void)setObject:(id)object atIndexedSubscript:(NSInteger)index;
@end
void *pvoid;
-int main() {
+int main(void) {
NSDictionary *dict = @{ @"name":@666 };
dict[@"name"] = @666;
@@ -64,7 +64,7 @@ int main() {
}
enum XXXYYYZZZType { XXXYYYZZZTypeAny }; // expected-note {{'XXXYYYZZZTypeAny' declared here}}
-void foo() {
+void foo(void) {
NSDictionary *d = @{
@"A" : @(XXXYYYZZZTypeA), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeA'; did you mean 'XXXYYYZZZTypeAny'}}
@"F" : @(XXXYYYZZZTypeSomethingSomething), // expected-error {{use of undeclared identifier 'XXXYYYZZZTypeSomethingSomething'}}
diff --git a/clang/test/SemaObjC/objc-independent-class-attribute.m b/clang/test/SemaObjC/objc-independent-class-attribute.m
index 2fc13f0cf1415..e9f58b0e73aa5 100644
--- a/clang/test/SemaObjC/objc-independent-class-attribute.m
+++ b/clang/test/SemaObjC/objc-independent-class-attribute.m
@@ -11,7 +11,7 @@ @interface NSObject @end
NSObject *__attribute__((objc_independent_class)) ns; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
} __attribute__((objc_independent_class)) T;
-dispatch_queue_t dispatch_queue_create();
+dispatch_queue_t dispatch_queue_create(void);
@interface DispatchQPointerCastIssue : NSObject {
NSObject *__attribute__((objc_independent_class)) Ivar; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
@@ -29,7 +29,7 @@ + (dispatch_queue_t) newDispatchQueue {
}
@end
-NSObject *get_nsobject() {
+NSObject *get_nsobject(void) {
typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;
dispatch_queue_t dt;
return dt;
diff --git a/clang/test/SemaObjC/objc-literal-fixit.m b/clang/test/SemaObjC/objc-literal-fixit.m
index fa117a3427453..7911d9fd60d51 100644
--- a/clang/test/SemaObjC/objc-literal-fixit.m
+++ b/clang/test/SemaObjC/objc-literal-fixit.m
@@ -13,7 +13,7 @@ +(instancetype)numberWithDouble:(double)value;
+(instancetype)numberWithBool:(BOOL)value;
@end
-void test() {
+void test(void) {
NSNumber *n = YES; // expected-error{{numeric literal must be prefixed by '@'}}
NSNumber *n1 = 1; // expected-error{{numeric literal must be prefixed by '@'}}
diff --git a/clang/test/SemaObjC/objc-literal-nsnumber.m b/clang/test/SemaObjC/objc-literal-nsnumber.m
index ceb31f8af156a..c4523643f32b9 100644
--- a/clang/test/SemaObjC/objc-literal-nsnumber.m
+++ b/clang/test/SemaObjC/objc-literal-nsnumber.m
@@ -9,7 +9,7 @@
typedef int NSInteger;
#endif
-void checkNSNumberUnavailableDiagnostic() {
+void checkNSNumberUnavailableDiagnostic(void) {
id num = @1000; // expected-error {{definition of class NSNumber must be available to use Objective-C numeric literals}}
int x = 1000;
@@ -19,7 +19,7 @@ void checkNSNumberUnavailableDiagnostic() {
@class NSNumber; // expected-note 2 {{forward declaration of class here}}
-void checkNSNumberFDDiagnostic() {
+void checkNSNumberFDDiagnostic(void) {
id num = @1000; // expected-error {{definition of class NSNumber must be available to use Objective-C numeric literals}}
int x = 1000;
@@ -50,7 +50,7 @@ + (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value ;
// rdar://16417427
int big = 1391126400;
int thousand = 1000;
-int main() {
+int main(void) {
NSNumber * N = @3.1415926535; // expected-error {{declaration of 'numberWithDouble:' is missing in NSNumber class}}
NSNumber *noNumber = @__objc_yes; // expected-error {{declaration of 'numberWithBool:' is missing in NSNumber class}}
NSNumber * NInt = @1000;
@@ -73,7 +73,7 @@ int main() {
// Dictionary test
@class NSDictionary; // expected-note {{forward declaration of class here}}
-NSDictionary *err() {
+NSDictionary *err(void) {
return @{@"name" : @"value"}; // expected-error {{definition of class NSDictionary must be available to use Objective-C dictionary literals}}
}
@@ -92,15 +92,15 @@ + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id<NSCopying> []
@interface NSString<NSCopying>
@end
-id NSUserName();
+id NSUserName(void);
-int Int();
+int Int(void);
-NSDictionary * blocks() {
+NSDictionary * blocks(void) {
return @{ @"task" : ^ { return 17; } };
}
-NSDictionary * warn() {
+NSDictionary * warn(void) {
NSDictionary *dictionary = @{@"name" : NSUserName(),
@"date" : [NSDate date],
@"name2" : @"other",
@@ -116,7 +116,7 @@ @interface NSString<NSCopying>
// rdar:// 11231426
typedef float BOOL;
-BOOL radar11231426() {
+BOOL radar11231426(void) {
return __objc_yes;
}
diff --git a/clang/test/SemaObjC/objc-literal-sig.m b/clang/test/SemaObjC/objc-literal-sig.m
index 48f69165efb27..146df199c756d 100644
--- a/clang/test/SemaObjC/objc-literal-sig.m
+++ b/clang/test/SemaObjC/objc-literal-sig.m
@@ -41,7 +41,7 @@ + (id)dictionaryWithObjects:(const id [])objects
// and then used un-checked.
const char *getStr(void);
-void test_sig() {
+void test_sig(void) {
(void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}}
(void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}}
id array = @[ @17 ]; // expected-error{{literal construction method 'arrayWithObjects:count:' has incompatible signature}}
diff --git a/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m b/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m
index 232f8dd794d6d..0a5a662da0962 100644
--- a/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m
+++ b/clang/test/SemaObjC/objc2-merge-gc-attribue-decl.m
@@ -7,11 +7,11 @@ @interface INTF @end
extern __strong id p1;
extern id p1;
-extern id CFRunLoopGetMain();
-extern __strong id CFRunLoopGetMain();
+extern id CFRunLoopGetMain(void);
+extern __strong id CFRunLoopGetMain(void);
-extern __weak id WLoopGetMain(); // expected-note {{previous declaration is here}}
-extern id WLoopGetMain(); // expected-error {{conflicting types for 'WLoopGetMain'}}
+extern __weak id WLoopGetMain(void); // expected-note {{previous declaration is here}}
+extern id WLoopGetMain(void); // expected-error {{conflicting types for 'WLoopGetMain'}}
extern id p3; // expected-note {{previous declaration is here}}
extern __weak id p3; // expected-error {{redeclaration of 'p3' with a
diff erent type}}
diff --git a/clang/test/SemaObjC/objc2-warn-weak-decl.m b/clang/test/SemaObjC/objc2-warn-weak-decl.m
index b85f7682a96b5..a29ff7b6e334f 100644
--- a/clang/test/SemaObjC/objc2-warn-weak-decl.m
+++ b/clang/test/SemaObjC/objc2-warn-weak-decl.m
@@ -4,7 +4,7 @@
__weak id p; // expected-warning {{__weak attribute cannot be specified on a field declaration}}
};
-int main ()
+int main (void)
{
__weak id local; // expected-warning {{Objective-C GC does not allow weak variables on the stack}}
}
diff --git a/clang/test/SemaObjC/objcbridge-attribute.m b/clang/test/SemaObjC/objcbridge-attribute.m
index c93543caa6797..de6fbe9f9caa9 100644
--- a/clang/test/SemaObjC/objcbridge-attribute.m
+++ b/clang/test/SemaObjC/objcbridge-attribute.m
@@ -135,10 +135,10 @@ void Test8(CFMyPersonalErrorRef cf) {
(void)(id<P1, P2, P3, P4, P5>)cf; // expected-warning {{'CFMyPersonalErrorRef' (aka 'struct __CFMyPersonalErrorRef *') bridges to MyPersonalError, not 'id<P1,P2,P3,P4,P5>'}}
}
-CFDictionaryRef bar() __attribute__((cf_returns_not_retained));
+CFDictionaryRef bar(void) __attribute__((cf_returns_not_retained));
@class NSNumber;
-void Test9() {
+void Test9(void) {
NSNumber *w2 = (NSNumber*) bar(); // expected-error {{CF object of type 'CFDictionaryRef' (aka 'struct __CFDictionary *') is bridged to 'NSDictionary', which is not an Objective-C class}}
}
diff --git a/clang/test/SemaObjC/opaque-is-access-warn.m b/clang/test/SemaObjC/opaque-is-access-warn.m
index 4f86866cfec28..e5fdef640c372 100644
--- a/clang/test/SemaObjC/opaque-is-access-warn.m
+++ b/clang/test/SemaObjC/opaque-is-access-warn.m
@@ -17,7 +17,7 @@ @interface Whatever : NSObject
+self;
@end
-static void func() {
+static void func(void) {
id x;
diff --git a/clang/test/SemaObjC/opaque-is-access.m b/clang/test/SemaObjC/opaque-is-access.m
index 89d91b3560636..ebb42ebbbb407 100644
--- a/clang/test/SemaObjC/opaque-is-access.m
+++ b/clang/test/SemaObjC/opaque-is-access.m
@@ -14,7 +14,7 @@ @interface Whatever : NSObject
+self;
@end
-static void func() {
+static void func(void) {
id x;
diff --git a/clang/test/SemaObjC/ovl-check.m b/clang/test/SemaObjC/ovl-check.m
index cc2f094ad2ead..b777c29178d5c 100644
--- a/clang/test/SemaObjC/ovl-check.m
+++ b/clang/test/SemaObjC/ovl-check.m
@@ -40,7 +40,7 @@ void testTakesNSString(id x) {
[x testStr:"someStringLiteral"];
}
-id CreateSomething();
+id CreateSomething(void);
@interface TakesCFTypeRef
- (void) testCFTypeRef:(CFTypeRef)arg;
diff --git a/clang/test/SemaObjC/parameterized_classes.m b/clang/test/SemaObjC/parameterized_classes.m
index 1004fd3c4b1eb..2b1dcc91a010f 100644
--- a/clang/test/SemaObjC/parameterized_classes.m
+++ b/clang/test/SemaObjC/parameterized_classes.m
@@ -298,7 +298,7 @@ @interface PC15<T : id, U : NSObject *, V : id<NSCopying>> : NSObject
typedef typeArgs15<NSObject> typeArgsAndProtocolQuals6;
-void testSpecializedTypePrinting() {
+void testSpecializedTypePrinting(void) {
int *ip;
ip = (typeArgs15*)0; // expected-warning{{'typeArgs15 *' (aka 'PC1<NSObject *,NSString *> *')}}
diff --git a/clang/test/SemaObjC/potentially-direct-selector.m b/clang/test/SemaObjC/potentially-direct-selector.m
index 04f9d2111c9b1..c5c9f39718bfc 100644
--- a/clang/test/SemaObjC/potentially-direct-selector.m
+++ b/clang/test/SemaObjC/potentially-direct-selector.m
@@ -79,7 +79,7 @@ -(void)test1 {
}
@end
-void test2() {
+void test2(void) {
(void)@selector(inBase); // strict-warning{{@selector expression formed with potentially direct selector}}
(void)@selector(inBaseImpl); // strict-warning{{@selector expression formed with potentially direct selector}}
(void)@selector(inBaseCat); // strict-warning{{@selector expression formed with potentially direct selector}}
diff --git a/clang/test/SemaObjC/property-10.m b/clang/test/SemaObjC/property-10.m
index 7bd0d3be08037..f35e93661e4fb 100644
--- a/clang/test/SemaObjC/property-10.m
+++ b/clang/test/SemaObjC/property-10.m
@@ -26,16 +26,16 @@ @interface I0
@property id p4; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for object}}
- at property(nonatomic,copy) int (^includeMailboxCondition)();
- at property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}}
+ at property(nonatomic,copy) int (^includeMailboxCondition)(void);
+ at property(nonatomic,copy) int (*includeMailboxCondition2)(void); // expected-error {{property with 'copy' attribute must be of object type}}
@end
@interface I0()
@property (retain) int PROP; // expected-error {{property with 'retain (or strong)' attribute must be of object type}}
@property (strong) int SPROP; // expected-error {{property with 'retain (or strong)' attribute must be of object type}}
- at property(nonatomic,copy) int (*PROP1)(); // expected-error {{property with 'copy' attribute must be of object type}}
- at property(nonatomic,weak) int (*PROP2)(); // expected-error {{property with 'weak' attribute must be of object type}}
+ at property(nonatomic,copy) int (*PROP1)(void); // expected-error {{property with 'copy' attribute must be of object type}}
+ at property(nonatomic,weak) int (*PROP2)(void); // expected-error {{property with 'weak' attribute must be of object type}}
@end
// rdar://10357768
diff --git a/clang/test/SemaObjC/property-13.m b/clang/test/SemaObjC/property-13.m
index 362d6d3b15d10..6f6dd0a653441 100644
--- a/clang/test/SemaObjC/property-13.m
+++ b/clang/test/SemaObjC/property-13.m
@@ -46,7 +46,7 @@ - (void) setOptional_getter_attr:(int)value { ivar = value; }
@end
void abort(void);
-int main ()
+int main (void)
{
Test *x = [[Test alloc] init];
/* 1. Test of a required property */
diff --git a/clang/test/SemaObjC/property-error-readonly-assign.m b/clang/test/SemaObjC/property-error-readonly-assign.m
index 3484172844b75..8b9b49a3932f0 100644
--- a/clang/test/SemaObjC/property-error-readonly-assign.m
+++ b/clang/test/SemaObjC/property-error-readonly-assign.m
@@ -23,7 +23,7 @@ void f0(A *a, B* b) {
int i1, i2;
} NSRect;
-NSRect NSMakeRect();
+NSRect NSMakeRect(void);
@interface NSWindow
{
diff --git a/clang/test/SemaObjC/property-expression-error.m b/clang/test/SemaObjC/property-expression-error.m
index e306722e6c51f..60a4966a0d956 100644
--- a/clang/test/SemaObjC/property-expression-error.m
+++ b/clang/test/SemaObjC/property-expression-error.m
@@ -11,13 +11,13 @@ @implementation AddressMyProperties
@synthesize index;
@end
-int main() {
+int main(void) {
AddressMyProperties *object;
&object.index; // expected-error {{address of property expression requested}}
return 0;
}
typedef int Foo;
-void test() {
+void test(void) {
Foo.x; // expected-error {{expected identifier or '('}}
}
diff --git a/clang/test/SemaObjC/property-in-class-extension.m b/clang/test/SemaObjC/property-in-class-extension.m
index a780a352199ee..eefc0df40cc49 100644
--- a/clang/test/SemaObjC/property-in-class-extension.m
+++ b/clang/test/SemaObjC/property-in-class-extension.m
@@ -7,7 +7,7 @@ @interface Foo ()
@property (readonly) int bar;
@end
-void FUNC () {
+void FUNC (void) {
Foo *foo;
foo.bar = 0; // expected-error {{assignment to readonly property}}
}
diff --git a/clang/test/SemaObjC/property-not-lvalue.m b/clang/test/SemaObjC/property-not-lvalue.m
index 12d2cc62ff477..4f8301b40ef31 100644
--- a/clang/test/SemaObjC/property-not-lvalue.m
+++ b/clang/test/SemaObjC/property-not-lvalue.m
@@ -13,7 +13,7 @@ @interface Foo {
@property NSSize size;
@end
-void foo() {
+void foo(void) {
Foo *f;
f.size.width = 2.2; // expected-error {{expression is not assignable}}
f.size.inner.dim = 200; // expected-error {{expression is not assignable}}
diff --git a/clang/test/SemaObjC/property.m b/clang/test/SemaObjC/property.m
index b67ac37b85e67..b03aea37f92c6 100644
--- a/clang/test/SemaObjC/property.m
+++ b/clang/test/SemaObjC/property.m
@@ -39,7 +39,7 @@ @interface Foo
@property double bar;
@end
-int func1() {
+int func1(void) {
id foo;
double bar = [foo bar];
return 0;
@@ -66,7 +66,7 @@ @interface Foo2
@synthesize window; // expected-error {{missing context for property implementation declaration}}
// rdar://10408414
-Class test6_getClass();
+Class test6_getClass(void);
@interface Test6
@end
@implementation Test6
diff --git a/clang/test/SemaObjC/protocol-attribute.m b/clang/test/SemaObjC/protocol-attribute.m
index 52bd44110fc91..3ca4ef68fc359 100644
--- a/clang/test/SemaObjC/protocol-attribute.m
+++ b/clang/test/SemaObjC/protocol-attribute.m
@@ -42,7 +42,7 @@ @interface MyClass2 <FwProto> // expected-error {{'FwProto' is unavailable}}
id <XProto> idX = 0; // expected-error {{'XProto' is unavailable}}
-int main ()
+int main (void)
{
MyClass1 <MyProto1> *p1; // expected-warning {{'MyProto1' is deprecated}}
}
diff --git a/clang/test/SemaObjC/protocol-expr-1.m b/clang/test/SemaObjC/protocol-expr-1.m
index 5ff3db474c75f..cefe9a9f5449c 100644
--- a/clang/test/SemaObjC/protocol-expr-1.m
+++ b/clang/test/SemaObjC/protocol-expr-1.m
@@ -8,7 +8,7 @@ @protocol p1
@class cl;
-int main()
+int main(void)
{
Protocol *proto = @protocol(p1);
Protocol *fproto = @protocol(fproto);
diff --git a/clang/test/SemaObjC/protocol-expr-neg-1.m b/clang/test/SemaObjC/protocol-expr-neg-1.m
index f659b30046e13..d5767eb27ba91 100644
--- a/clang/test/SemaObjC/protocol-expr-neg-1.m
+++ b/clang/test/SemaObjC/protocol-expr-neg-1.m
@@ -9,7 +9,7 @@ @protocol p1
@class cl;
-int main()
+int main(void)
{
Protocol *proto = @protocol(p1);
Protocol *fproto = @protocol(fproto); // expected-error {{@protocol is using a forward protocol declaration of 'fproto'}}
diff --git a/clang/test/SemaObjC/protocol-typecheck.m b/clang/test/SemaObjC/protocol-typecheck.m
index 4eb1b2641af2b..0166cc3c09f6e 100644
--- a/clang/test/SemaObjC/protocol-typecheck.m
+++ b/clang/test/SemaObjC/protocol-typecheck.m
@@ -13,7 +13,7 @@ - (void)setFlexElement2:(NSObject <PWhatever, XCElementSpacerP> *)flexer; // exp
@end
-void func() {
+void func(void) {
NSObject <PWhatever, XCElementSpacerP> * flexer;
NSObject <PWhatever, XCElementP> * flexer2;
XX *obj;
diff --git a/clang/test/SemaObjC/protocol-warn.m b/clang/test/SemaObjC/protocol-warn.m
index 04df5031ab474..ca875b06b202e 100644
--- a/clang/test/SemaObjC/protocol-warn.m
+++ b/clang/test/SemaObjC/protocol-warn.m
@@ -47,7 +47,7 @@ @interface UIWebPDFView : UIPDFView
@implementation UIWebPDFView
@end
-UIWebPDFView *getView()
+UIWebPDFView *getView(void)
{
UIWebBrowserView *browserView;
UIWebPDFView *pdfView;
diff --git a/clang/test/SemaObjC/rdar6248119.m b/clang/test/SemaObjC/rdar6248119.m
index a495978391297..afde67b6028df 100644
--- a/clang/test/SemaObjC/rdar6248119.m
+++ b/clang/test/SemaObjC/rdar6248119.m
@@ -3,7 +3,7 @@
// Test case for:
// <rdar://problem/6248119> @finally doesn't introduce a new scope
-void f0() {
+void f0(void) {
int i;
@try {
} @finally {
@@ -11,7 +11,7 @@ void f0() {
}
}
-void f1() {
+void f1(void) {
int i;
@try {
int i =0;
@@ -19,7 +19,7 @@ void f1() {
}
}
-void f2() {
+void f2(void) {
int i;
@try {
} @catch(id e) {
diff --git a/clang/test/SemaObjC/related-result-type-inference.m b/clang/test/SemaObjC/related-result-type-inference.m
index 547e83fd01350..6b7e9c40990aa 100644
--- a/clang/test/SemaObjC/related-result-type-inference.m
+++ b/clang/test/SemaObjC/related-result-type-inference.m
@@ -45,7 +45,7 @@ @interface NSBlah ()
+ (Unrelated *)newUnrelated;
@end
-void test_inference() {
+void test_inference(void) {
// Inference based on method family
__typeof__(([[NSString alloc] init])) *str = (NSString**)0;
__typeof__(([[[[NSString new] self] retain] autorelease])) *str2 = (NSString **)0;
diff --git a/clang/test/SemaObjC/resolve-method-in-global-pool.m b/clang/test/SemaObjC/resolve-method-in-global-pool.m
index 523856d663f63..f74d6e2e2207b 100644
--- a/clang/test/SemaObjC/resolve-method-in-global-pool.m
+++ b/clang/test/SemaObjC/resolve-method-in-global-pool.m
@@ -57,7 +57,7 @@ @interface NSConnection
@interface AppDelegate
@end
-AppDelegate* GetDelegate()
+AppDelegate* GetDelegate(void)
{
return [NSApp delegate];
}
diff --git a/clang/test/SemaObjC/return.m b/clang/test/SemaObjC/return.m
index f69d41eaade94..a4e69597765c5 100644
--- a/clang/test/SemaObjC/return.m
+++ b/clang/test/SemaObjC/return.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-noreturn -fobjc-exceptions -Wno-objc-root-class %s
-int test1() {
+int test1(void) {
id a;
@throw a;
}
@@ -25,7 +25,7 @@ void test3(int a) { // expected-warning {{function 'test3' could be declared wi
// issue a noreturn warning.
@class NSException;
@class NSString;
-NSString *rdar_4289832() { // no-warning
+NSString *rdar_4289832(void) { // no-warning
@try
{
return @"a";
diff --git a/clang/test/SemaObjC/scope-check.m b/clang/test/SemaObjC/scope-check.m
index b23edd1240f9b..563dca05db795 100644
--- a/clang/test/SemaObjC/scope-check.m
+++ b/clang/test/SemaObjC/scope-check.m
@@ -2,7 +2,7 @@
@class A, B, C;
-void test1() {
+void test1(void) {
goto L; // expected-error{{cannot jump}}
goto L2; // expected-error{{cannot jump}}
goto L3; // expected-error{{cannot jump}}
@@ -64,7 +64,7 @@ void test2(int a) {
}
// rdar://6803963
-void test3() {
+void test3(void) {
@try {
goto blargh;
blargh: ;
diff --git a/clang/test/SemaObjC/selector-1.m b/clang/test/SemaObjC/selector-1.m
index 4efa0d7117879..e9d5f064ab3d9 100644
--- a/clang/test/SemaObjC/selector-1.m
+++ b/clang/test/SemaObjC/selector-1.m
@@ -9,13 +9,13 @@ @interface J
- (id) compare: (id) arg1; // expected-note {{method 'compare:' declared here}}
@end
-SEL func()
+SEL func(void)
{
return @selector(compare:); // expected-warning {{several methods with selector 'compare:' of mismatched types are found for the @selector expression}}
}
// rdar://16458579
-void Test16458579() {
+void Test16458579(void) {
SEL s = @selector((retain));
SEL s1 = @selector((meth1:));
SEL s2 = @selector((retainArgument::));
@@ -26,7 +26,7 @@ void Test16458579() {
SEL s7 = @selector((char:float:double:unsigned:short:long:));
SEL s9 = @selector((:enum:bool:));
}
-int main() {
+int main(void) {
SEL s = @selector(retain);
SEL s1 = @selector(meth1:);
SEL s2 = @selector(retainArgument::);
diff --git a/clang/test/SemaObjC/selector-2.m b/clang/test/SemaObjC/selector-2.m
index 17d1872cc7ea2..0bd99faf76a8d 100644
--- a/clang/test/SemaObjC/selector-2.m
+++ b/clang/test/SemaObjC/selector-2.m
@@ -5,7 +5,7 @@ @interface I
- length;
@end
-static inline SEL IsEmpty() {
+static inline SEL IsEmpty(void) {
return @selector(length);
}
diff --git a/clang/test/SemaObjC/selector-3.m b/clang/test/SemaObjC/selector-3.m
index 80332ec0d4744..34dd724517134 100644
--- a/clang/test/SemaObjC/selector-3.m
+++ b/clang/test/SemaObjC/selector-3.m
@@ -23,7 +23,7 @@ @interface I
- length;
@end
-SEL func()
+SEL func(void)
{
return @selector(length); // expected-warning {{no method with selector 'length' is implemented in this translation unit}}
}
@@ -130,7 +130,7 @@ - (int) compare: (J16428638 *) arg1 {
}
@end
-void test16428638() {
+void test16428638(void) {
SEL s = @selector(compare:);
(void)s;
}
diff --git a/clang/test/SemaObjC/selector-4.m b/clang/test/SemaObjC/selector-4.m
index 59a8233f6bc1e..63691280403b2 100644
--- a/clang/test/SemaObjC/selector-4.m
+++ b/clang/test/SemaObjC/selector-4.m
@@ -18,7 +18,7 @@ @interface MyObject : NSObject
@end
#else
-int main() {
+int main(void) {
(void)@selector(compare:);
}
diff --git a/clang/test/SemaObjC/selector-overload.m b/clang/test/SemaObjC/selector-overload.m
index 447607a1f754c..b34d98f1b4253 100644
--- a/clang/test/SemaObjC/selector-overload.m
+++ b/clang/test/SemaObjC/selector-overload.m
@@ -41,7 +41,7 @@ @interface Rar : NSObject
@end
-int main() {
+int main(void) {
id xx = [[Car alloc] init]; // expected-warning {{incompatible types assigning 'int' to 'id'}}
[xx method:4];
diff --git a/clang/test/SemaObjC/setter-dotsyntax.m b/clang/test/SemaObjC/setter-dotsyntax.m
index ec47ee2a8e9f5..7e205ca756182 100644
--- a/clang/test/SemaObjC/setter-dotsyntax.m
+++ b/clang/test/SemaObjC/setter-dotsyntax.m
@@ -12,7 +12,7 @@ - (void) setLevel:(int)inLevel;
@interface MyClass : NSObject <MyProtocol>
@end
-int main ()
+int main (void)
{
id<MyProtocol> c;
c.level = 10;
diff --git a/clang/test/SemaObjC/sign-conversion.m b/clang/test/SemaObjC/sign-conversion.m
index 584ea1920271a..a340c15696bd9 100644
--- a/clang/test/SemaObjC/sign-conversion.m
+++ b/clang/test/SemaObjC/sign-conversion.m
@@ -20,7 +20,7 @@ - (id)objectAtIndexedSubscript:(NSUInteger)index;
@end
-void foo() {
+void foo(void) {
X *x = [X new];
signed int sint = -1;
[x setUint:sint]; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
@@ -28,7 +28,7 @@ void foo() {
}
// rdar://13855682
-void Test1() {
+void Test1(void) {
signed int si = -1;
NSArray *array;
diff --git a/clang/test/SemaObjC/signed-char-bool-conversion.m b/clang/test/SemaObjC/signed-char-bool-conversion.m
index 9442d8fa86a90..4c323903b47ef 100644
--- a/clang/test/SemaObjC/signed-char-bool-conversion.m
+++ b/clang/test/SemaObjC/signed-char-bool-conversion.m
@@ -13,7 +13,7 @@
int i;
int *ptr;
-void t1() {
+void t1(void) {
b = boolean;
b = fl; // expected-warning {{implicit conversion from floating-point type 'float' to 'BOOL'}}
b = i; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}}
diff --git a/clang/test/SemaObjC/sizeof-interface.m b/clang/test/SemaObjC/sizeof-interface.m
index db765b79b4d8a..8325b16295773 100644
--- a/clang/test/SemaObjC/sizeof-interface.m
+++ b/clang/test/SemaObjC/sizeof-interface.m
@@ -80,7 +80,7 @@ - (unsigned long)gatherStats:(id )stats
@interface Foo @end
-int foo()
+int foo(void)
{
Foo *f;
diff --git a/clang/test/SemaObjC/special-dep-unavail-warning.m b/clang/test/SemaObjC/special-dep-unavail-warning.m
index b667c3c51c9df..fdf907eee429a 100644
--- a/clang/test/SemaObjC/special-dep-unavail-warning.m
+++ b/clang/test/SemaObjC/special-dep-unavail-warning.m
@@ -49,7 +49,7 @@ @interface DEPRECATED
+(id)new;
@end
-void foo() {
+void foo(void) {
[DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}}
}
diff --git a/clang/test/SemaObjC/static-ivar-ref-1.m b/clang/test/SemaObjC/static-ivar-ref-1.m
index d9f99f513da72..ff48d93508179 100644
--- a/clang/test/SemaObjC/static-ivar-ref-1.m
+++ b/clang/test/SemaObjC/static-ivar-ref-1.m
@@ -12,7 +12,7 @@ @interface current
current *pc;
-int foo()
+int foo(void)
{
return pc->ivar2 + (*pc).ivar + pc->ivar1;
}
diff --git a/clang/test/SemaObjC/super-property-notation.m b/clang/test/SemaObjC/super-property-notation.m
index 7d7b84deb7cdb..17a7e8116c904 100644
--- a/clang/test/SemaObjC/super-property-notation.m
+++ b/clang/test/SemaObjC/super-property-notation.m
@@ -22,7 +22,7 @@ -(void) method {
}
@end
-void f0() {
+void f0(void) {
// FIXME: not implemented yet.
//int l1 = A.classGetter;
int l2 = [A classGetter2];
diff --git a/clang/test/SemaObjC/super.m b/clang/test/SemaObjC/super.m
index fd069af7b02c9..84a70388103a3 100644
--- a/clang/test/SemaObjC/super.m
+++ b/clang/test/SemaObjC/super.m
@@ -62,7 +62,7 @@ void f1(id puper) { // expected-note {{'puper' declared here}}
typedef Foo FooTD;
-void test() {
+void test(void) {
[FooTD cMethod];
[super cMethod];
}
@@ -71,12 +71,12 @@ void test() {
int X;
};
-int test2() {
+int test2(void) {
struct SomeStruct super = { 0 };
return super.X;
}
-int test3() {
+int test3(void) {
id super = 0;
[(B*)super instanceMethod];
int *s1 = (int*)super;
diff --git a/clang/test/SemaObjC/synchronized.m b/clang/test/SemaObjC/synchronized.m
index c158815acbf87..21ffc328b3593 100644
--- a/clang/test/SemaObjC/synchronized.m
+++ b/clang/test/SemaObjC/synchronized.m
@@ -14,7 +14,7 @@ - (void) unregisterTask:(id) task {
struct x { int a; } b;
-void test1() {
+void test1(void) {
@synchronized (b) { // expected-error {{@synchronized requires an Objective-C object type ('struct x' invalid)}}
}
diff --git a/clang/test/SemaObjC/synth-provisional-ivars-1.m b/clang/test/SemaObjC/synth-provisional-ivars-1.m
index 39f474727b7b7..3dddaa613ef1e 100644
--- a/clang/test/SemaObjC/synth-provisional-ivars-1.m
+++ b/clang/test/SemaObjC/synth-provisional-ivars-1.m
@@ -11,7 +11,7 @@ @interface MailApp
@property(assign) BOOL isAppleInternal;
@end
-static BOOL isAppleInternal() {return 0; }
+static BOOL isAppleInternal(void) {return 0; }
@implementation MailApp
diff --git a/clang/test/SemaObjC/transfer-boxed-string-nullability.m b/clang/test/SemaObjC/transfer-boxed-string-nullability.m
index a3b6832be463c..71ee2f46a7f81 100644
--- a/clang/test/SemaObjC/transfer-boxed-string-nullability.m
+++ b/clang/test/SemaObjC/transfer-boxed-string-nullability.m
@@ -15,7 +15,7 @@ @interface NSString
void takesNonNull(NSString * _Nonnull ptr);
-void testBoxedString() {
+void testBoxedString(void) {
// No diagnostic emitted as this doesn't need a stringWithUTF8String message
// send.
takesNonNull(@("hey"));
diff --git a/clang/test/SemaObjC/try-catch.m b/clang/test/SemaObjC/try-catch.m
index 04d4ff87ed1d1..0bea7a5150a49 100644
--- a/clang/test/SemaObjC/try-catch.m
+++ b/clang/test/SemaObjC/try-catch.m
@@ -42,7 +42,7 @@ - (NSDictionary *)anotherFunction {
} // FIXME: This should warn about a missing return too.
@end
-int foo() {
+int foo(void) {
struct s { int a, b; } agg, *pagg;
@throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
diff --git a/clang/test/SemaObjC/ucn-objc-string.m b/clang/test/SemaObjC/ucn-objc-string.m
index f80d1ffb91567..b0a51ef07a92c 100644
--- a/clang/test/SemaObjC/ucn-objc-string.m
+++ b/clang/test/SemaObjC/ucn-objc-string.m
@@ -3,7 +3,7 @@
@class NSString;
extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
-int main() {
+int main(void) {
NSLog(@"Hi…");
NSLog(@"Exposé");
NSLog(@"\U00010400\U0001D12B");
diff --git a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m
index 9d05a2ba99e55..8d17df152e9b0 100644
--- a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m
+++ b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m
@@ -11,9 +11,9 @@
#define AVAILABLE_CURRENT __attribute__((availability(macCatalyst, introduced = 14)))
#define AVAILABLE_NEXT __attribute__((availability(macCatalyst, introduced = 14.1)))
-void previouslyAvailable() AVAILABLE_PREV;
-void currentlyAvailable() AVAILABLE_CURRENT;
-void willBeAvailabile() AVAILABLE_NEXT;
+void previouslyAvailable(void) AVAILABLE_PREV;
+void currentlyAvailable(void) AVAILABLE_CURRENT;
+void willBeAvailabile(void) AVAILABLE_NEXT;
#ifndef NO_WARNING
// expected-note at -2 {{'willBeAvailabile' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}}
#endif
@@ -36,7 +36,7 @@
AVAILABLE_NEXT
Record var2;
-void test() {
+void test(void) {
previouslyAvailable();
currentlyAvailable();
willBeAvailabile();
@@ -52,14 +52,14 @@ void test() {
willBeAvailabile(); // OK
}
-void previouslyAvailableIOS() __attribute__((availability(ios, introduced = 10)));
-void currentlyAvailableIOS() __attribute__((availability(ios, introduced = 14)));
-void willBeAvailabileIOS() __attribute__((availability(ios, introduced = 14.1)));
+void previouslyAvailableIOS(void) __attribute__((availability(ios, introduced = 10)));
+void currentlyAvailableIOS(void) __attribute__((availability(ios, introduced = 14)));
+void willBeAvailabileIOS(void) __attribute__((availability(ios, introduced = 14.1)));
#ifndef NO_WARNING
// expected-note at -2 {{'willBeAvailabileIOS' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}}
#endif
-void testIOSAvailabilityAlsoWorks() {
+void testIOSAvailabilityAlsoWorks(void) {
previouslyAvailableIOS();
currentlyAvailableIOS();
willBeAvailabileIOS();
diff --git a/clang/test/SemaObjC/unguarded-availability-new.m b/clang/test/SemaObjC/unguarded-availability-new.m
index ed61bf9779580..eba25a6b01761 100644
--- a/clang/test/SemaObjC/unguarded-availability-new.m
+++ b/clang/test/SemaObjC/unguarded-availability-new.m
@@ -66,15 +66,15 @@
#define AVAILABLE_NEXT __attribute__((availability(watchos, introduced = 5)))
#endif
-void previouslyAvailable() AVAILABLE_PREV;
+void previouslyAvailable(void) AVAILABLE_PREV;
#ifdef WARN_PREV
// expected-note at -2 {{'previouslyAvailable' has been marked as being introduced}}
#endif
-void currentlyAvailable() AVAILABLE_CURRENT;
+void currentlyAvailable(void) AVAILABLE_CURRENT;
#ifdef WARN_CURRENT
// expected-note at -2 {{'currentlyAvailable' has been marked as being introduced}}
#endif
-void willBeAvailabile() AVAILABLE_NEXT;
+void willBeAvailabile(void) AVAILABLE_NEXT;
#ifndef NO_WARNING
// expected-note at -2 {{'willBeAvailabile' has been marked as being introduced in}}
#endif
@@ -109,7 +109,7 @@
#endif
#endif
-void test() FUNC_AVAILABLE {
+void test(void) FUNC_AVAILABLE {
previouslyAvailable();
#ifdef WARN_PREV
#ifdef MAC
diff --git a/clang/test/SemaObjC/unguarded-availability.m b/clang/test/SemaObjC/unguarded-availability.m
index dffad1dbe0f0f..ad94eb71a29fe 100644
--- a/clang/test/SemaObjC/unguarded-availability.m
+++ b/clang/test/SemaObjC/unguarded-availability.m
@@ -7,16 +7,16 @@
typedef int AVAILABLE_10_12 new_int; // expected-note + {{'new_int' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}}
-int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}}
+int func_10_11(void) AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}}
#ifdef OBJCPP
// expected-note at +2 6 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}}
#endif
-int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}}
+int func_10_12(void) AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}}
-int func_10_0() AVAILABLE_10_0;
+int func_10_0(void) AVAILABLE_10_0;
-void use_func() {
+void use_func(void) {
func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}}
if (@available(macos 10.11, *))
@@ -25,13 +25,13 @@ void use_func() {
func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}}
}
-void defn_10_11() AVAILABLE_10_11;
+void defn_10_11(void) AVAILABLE_10_11;
-void defn_10_11() {
+void defn_10_11(void) {
func_10_11();
}
-void nested_ifs() {
+void nested_ifs(void) {
if (@available(macos 10.12, *)) {
if (@available(macos 10.10, *)) {
func_10_12();
@@ -43,7 +43,7 @@ void nested_ifs() {
}
}
-void star_case() {
+void star_case(void) {
if (@available(ios 9, *)) {
func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}}
func_10_0();
@@ -67,7 +67,7 @@ void star_case() {
#endif
typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}}
-void use_typedef() {
+void use_typedef(void) {
int_10_11 x; // expected-warning{{'int_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'int_10_11' in an @available check to silence this warning}}
}
@@ -92,7 +92,7 @@ - (void)method2 AVAILABLE_10_12 {
@end
-int protected_scope() {
+int protected_scope(void) {
if (@available(macos 10.20, *)) { // expected-note 2 {{jump enters controlled statement of if available}}
label1:
return 0;
@@ -113,7 +113,7 @@ int protected_scope() {
} n;
};
-int test_members() {
+int test_members(void) {
struct S s;
(void)s.m1;
(void)s.m2; // expected-warning{{'m2' is only available on macOS 10.12 or newer}} expected-note{{@available}}
@@ -121,7 +121,7 @@ int test_members() {
(void)s.n.nested_member; // expected-warning{{'nested_member' is only available on macOS 10.12 or newer}} expected-note{{@available}}
}
-void test_blocks() {
+void test_blocks(void) {
(void) ^{
func_10_12(); // expected-warning{{'func_10_12' is only available on macOS 10.12 or newer}} expected-note{{@available}}
};
@@ -139,7 +139,7 @@ void test_blocks() {
void test_params2(int_10_12 x) AVAILABLE_10_12; // no warn
-void (^topLevelBlockDecl)() = ^ {
+void (^topLevelBlockDecl)(void) = ^ {
func_10_12(); // expected-warning{{'func_10_12' is only available on macOS 10.12 or newer}} expected-note{{@available}}
if (@available(macos 10.12, *))
func_10_12();
@@ -165,13 +165,13 @@ void test_at(Subscriptable *x) {
id y = x[42]; // expected-warning{{'objectAtIndexedSubscript:' is only available on macOS 10.12 or newer}} expected-note{{@available}}
}
-void uncheckAtAvailable() {
+void uncheckAtAvailable(void) {
if (@available(macOS 10.12, *) || 0) // expected-warning {{@available does not guard availability here; use if (@available) instead}}
func_10_12(); // expected-warning {{'func_10_12' is only available on macOS 10.12 or newer}}
// expected-note at -1 {{enclose 'func_10_12' in an @available check to silence this warning}}
}
-void justAtAvailable() {
+void justAtAvailable(void) {
int availability = @available(macOS 10.12, *); // expected-warning {{@available does not guard availability here; use if (@available) instead}}
}
@@ -296,7 +296,7 @@ @interface Proper // expected-note{{annotate 'Proper' with an availability attri
@property (class) new_int x; // expected-warning{{'new_int' is only available}}
@end
-void with_local_struct() {
+void with_local_struct(void) {
struct local {
new_int x; // expected-warning{{'new_int' is only available}} expected-note{{enclose 'new_int' in an @available check}}
};
@@ -384,15 +384,15 @@ + (void)load: (int)x {
@end
__attribute__((constructor))
-void is_constructor();
+void is_constructor(void);
AVAILABLE_10_11 // expected-warning{{ignoring availability attribute with constructor attribute}}
-void is_constructor() {
+void is_constructor(void) {
func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}}
}
AVAILABLE_10_11 // expected-warning{{ignoring availability attribute with destructor attribute}}
__attribute__((destructor))
-void is_destructor() {
+void is_destructor(void) {
func_10_11(); // expected-warning{{'func_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'func_10_11' in an @available check to silence this warning}}
}
diff --git a/clang/test/SemaObjC/uninit-variables.m b/clang/test/SemaObjC/uninit-variables.m
index a3312264f0c2c..34bc337a1614f 100644
--- a/clang/test/SemaObjC/uninit-variables.m
+++ b/clang/test/SemaObjC/uninit-variables.m
@@ -13,13 +13,13 @@ - (void)raise;
// Duplicated from uninit-variables.c.
// Test just to ensure the analysis is working.
-int test1() {
+int test1(void) {
int x; // expected-note{{initialize the variable 'x' to silence this warning}}
return x; // expected-warning{{variable 'x' is uninitialized when used here}}
}
// Test ObjC fast enumeration.
-void test2() {
+void test2(void) {
id collection = 0;
for (id obj in collection) {
if (0 == obj) // no-warning
@@ -27,7 +27,7 @@ void test2() {
}
}
-void test3() {
+void test3(void) {
id collection = 0;
id obj;
for (obj in collection) { // no-warning
diff --git a/clang/test/SemaObjC/unknown-anytype.m b/clang/test/SemaObjC/unknown-anytype.m
index 38e058c513f6a..62ee4cf6a8df8 100644
--- a/clang/test/SemaObjC/unknown-anytype.m
+++ b/clang/test/SemaObjC/unknown-anytype.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -verify %s
extern __unknown_anytype test0;
-extern __unknown_anytype test1();
+extern __unknown_anytype test1(void);
@interface A
- (int*)getIntPtr;
@@ -13,7 +13,7 @@ - (float*)getFloatPtr;
- (short*)getSomePtr;
@end
-void test_unknown_anytype_receiver() {
+void test_unknown_anytype_receiver(void) {
int *ip = [test0 getIntPtr];
float *fp = [test1() getFloatPtr];
double *dp = [test1() getSomePtr]; // okay: picks first method found
diff --git a/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m b/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m
index e6fa13850fbd1..7dda02d989fc5 100644
--- a/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m
+++ b/clang/test/SemaObjC/unqualified-to-qualified-class-warn.m
@@ -22,7 +22,7 @@ - (void)foo {
void functionTakingAClassConformingToAProtocol(AClass <Fooable> *instance) { // expected-note {{passing argument to parameter 'instance' here}}
}
-int main () {
+int main (void) {
AClass *aobject = 0;
BClass *bobject = 0;
functionTakingAClassConformingToAProtocol(aobject); // expected-warning {{incompatible pointer types passing 'AClass *' to parameter of type 'AClass<Fooable> *'}}
diff --git a/clang/test/SemaObjC/unused.m b/clang/test/SemaObjC/unused.m
index 088f5b457773a..16f1e40410120 100644
--- a/clang/test/SemaObjC/unused.m
+++ b/clang/test/SemaObjC/unused.m
@@ -20,7 +20,7 @@ @interface NSString : NSObject
- (int)length;
@end
-void test2() {
+void test2(void) {
@"pointless example call for test purposes".length; // expected-warning {{property access result unused - getters should not be used for side effects}}
}
diff --git a/clang/test/SemaObjC/warn-cast-of-sel-expr.m b/clang/test/SemaObjC/warn-cast-of-sel-expr.m
index 1253db95d5af8..a8fa32efeede8 100644
--- a/clang/test/SemaObjC/warn-cast-of-sel-expr.m
+++ b/clang/test/SemaObjC/warn-cast-of-sel-expr.m
@@ -6,7 +6,7 @@
SEL sel_registerName(const char *);
-int main() {
+int main(void) {
(char *)s; // expected-warning {{cast of type 'SEL' to 'char *' is deprecated; use sel_getName instead}}
(void *)s; // ok
(const char *)sel_registerName("foo"); // expected-warning {{cast of type 'SEL' to 'const char *' is deprecated; use sel_getName instead}}
diff --git a/clang/test/SemaObjC/warn-direct-ivar-access.m b/clang/test/SemaObjC/warn-direct-ivar-access.m
index 946e516aad8fb..f9530721dac68 100644
--- a/clang/test/SemaObjC/warn-direct-ivar-access.m
+++ b/clang/test/SemaObjC/warn-direct-ivar-access.m
@@ -30,7 +30,7 @@ - (id) init {
- (void) dealloc { _myLeader = 0; }
@end
-MyObject * foo ()
+MyObject * foo (void)
{
MyObject* p=0;
p.isTickledPink = p.myLeader; // ok
diff --git a/clang/test/SemaObjC/warn-incompatible-builtin-types.m b/clang/test/SemaObjC/warn-incompatible-builtin-types.m
index fd4fb7d3a11d9..6326ab88f27ab 100644
--- a/clang/test/SemaObjC/warn-incompatible-builtin-types.m
+++ b/clang/test/SemaObjC/warn-incompatible-builtin-types.m
@@ -5,7 +5,7 @@ @interface Foo
- (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}}
@end
-void FUNC() {
+void FUNC(void) {
Class c, c1;
SEL s1, s2;
id i, i1;
diff --git a/clang/test/SemaObjC/warn-loop-analysis.m b/clang/test/SemaObjC/warn-loop-analysis.m
index 8ae7375f7f2d8..6818024688f29 100644
--- a/clang/test/SemaObjC/warn-loop-analysis.m
+++ b/clang/test/SemaObjC/warn-loop-analysis.m
@@ -7,7 +7,7 @@ - (id)objectAtIndexedSubscript:(unsigned int)idx;
// Do not warn on objc classes has objectAtIndexedSubscript method.
MyArray *test;
-void foo()
+void foo(void)
{
unsigned int i;
for (i = 42; i > 0;) // No warnings here
diff --git a/clang/test/SemaObjC/warn-retain-block-property.m b/clang/test/SemaObjC/warn-retain-block-property.m
index 84cdd9ff419c2..981e1bd5a7daa 100644
--- a/clang/test/SemaObjC/warn-retain-block-property.m
+++ b/clang/test/SemaObjC/warn-retain-block-property.m
@@ -4,7 +4,7 @@
// RUN: not %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class %s 2>&1 | FileCheck %s
// rdar://11761511
-extern void doSomething();
+extern void doSomething(void);
@interface Test
{
@@ -24,7 +24,7 @@ @implementation Test
@dynamic aBlockW, aBlockS, aBlockR, aBlockC, aBlockA;
@end
-int main() {
+int main(void) {
Test *t;
t.aBlock = ^{ doSomething(); };
t.aBlockW = ^{ doSomething(); };
diff --git a/clang/test/SemaObjC/warn-retain-cycle.m b/clang/test/SemaObjC/warn-retain-cycle.m
index eadd227f86d1f..88cf2c26b62b5 100644
--- a/clang/test/SemaObjC/warn-retain-cycle.m
+++ b/clang/test/SemaObjC/warn-retain-cycle.m
@@ -130,7 +130,7 @@ - (void) test_positive {
@end
-void testBlockVariable() {
+void testBlockVariable(void) {
typedef void (^block_t)(void);
// This case will be caught by -Wuninitialized, and does not create a
diff --git a/clang/test/SemaObjC/warn-strict-selector-match.m b/clang/test/SemaObjC/warn-strict-selector-match.m
index 6b92cb805df17..85f1868371df5 100644
--- a/clang/test/SemaObjC/warn-strict-selector-match.m
+++ b/clang/test/SemaObjC/warn-strict-selector-match.m
@@ -8,7 +8,7 @@ @interface Bar
-(float) method; // expected-note {{also found}}
@end
-int main() { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}}
+int main(void) { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}}
@interface Object @end
diff --git a/clang/test/SemaObjC/warn-unreachable.m b/clang/test/SemaObjC/warn-unreachable.m
index 366767629d2da..253d443a1339b 100644
--- a/clang/test/SemaObjC/warn-unreachable.m
+++ b/clang/test/SemaObjC/warn-unreachable.m
@@ -3,14 +3,14 @@
// This previously triggered a warning from -Wunreachable-code because of
// a busted CFG.
typedef signed char BOOL;
-BOOL radar10989084() {
+BOOL radar10989084(void) {
@autoreleasepool { // no-warning
return __objc_yes;
}
}
// Test the warning works.
-void test_unreachable() {
+void test_unreachable(void) {
return;
return; // expected-warning {{will never be executed}}
}
@@ -20,21 +20,21 @@ void test_unreachable() {
#define CONFIG NO
// Test that 'NO' and 'YES' are not treated as configuration macros.
-int test_NO() {
+int test_NO(void) {
if (NO)
return 1; // expected-warning {{will never be executed}}
else
return 0;
}
-int test_YES() {
+int test_YES(void) {
if (YES)
return 1;
else
return 0; // expected-warning {{will never be executed}}
}
-int test_CONFIG() {
+int test_CONFIG(void) {
if (CONFIG)
return 1;
else
@@ -49,7 +49,7 @@ void test_loop_increment(id container) {
}
}
-void calledFun() {}
+void calledFun(void) {}
// Test "silencing" with parentheses.
void test_with_paren_silencing(int x) {
diff --git a/clang/test/SemaObjC/warn-unused-exception-param.m b/clang/test/SemaObjC/warn-unused-exception-param.m
index 221e16ff64782..968a6e0282156 100644
--- a/clang/test/SemaObjC/warn-unused-exception-param.m
+++ b/clang/test/SemaObjC/warn-unused-exception-param.m
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Wunused-exception-parameter %s
-void f0() {
+void f0(void) {
@try {} @catch(id a) {} // expected-warning{{unused exception parameter 'a'}}
}
diff --git a/clang/test/SemaObjC/warn-weak-field.m b/clang/test/SemaObjC/warn-weak-field.m
index e7b0fe2694d67..856bf17f26ea9 100644
--- a/clang/test/SemaObjC/warn-weak-field.m
+++ b/clang/test/SemaObjC/warn-weak-field.m
@@ -17,7 +17,7 @@ @implementation I
- (void) foo { w = 0; LHS = w; }
@end
-int main ()
+int main (void)
{
struct I {
__weak id w1; // expected-warning {{__weak attribute cannot be specified on a field declaration}}
More information about the cfe-commits
mailing list