[clang] 1c25580 - Use functions with prototypes when appropriate; NFC
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 24 12:30:22 PST 2022
Author: Aaron Ballman
Date: 2022-02-24T15:30:13-05:00
New Revision: 1c2558021c155878c305701e11e3714cb521f599
URL: https://github.com/llvm/llvm-project/commit/1c2558021c155878c305701e11e3714cb521f599
DIFF: https://github.com/llvm/llvm-project/commit/1c2558021c155878c305701e11e3714cb521f599.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 final batch of tests being updated to add prototypes,
hopefully.
Added:
Modified:
clang/test/AST/ast-dump-expr-json.m
clang/test/AST/ast-dump-stmt-json.c
clang/test/AST/ast-dump-stmt-json.m
clang/test/Analysis/OSAtomic_mac.c
clang/test/CodeGen/2005-02-27-MarkGlobalConstant.c
clang/test/CodeGen/2010-07-14-ref-off-end.c
clang/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
clang/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
clang/test/CodeGen/X86/fp-eval-method.c
clang/test/CodeGen/block-copy.c
clang/test/CodeGen/block-with-perdefinedexpr.c
clang/test/CodeGen/debug-info-block-out-return.c
clang/test/CodeGen/debug-info-file-checksum.c
clang/test/CodeGen/merge-attrs.c
clang/test/CodeGen/sret2.c
clang/test/CodeGenObjC/Inputs/nsvalue-boxed-expressions-support.h
clang/test/CodeGenObjC/arc-blocks.m
clang/test/CodeGenObjC/interface.m
clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m
clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m
clang/test/Sema/Inputs/diagnose-if-warn-system-header.h
clang/test/Sema/c2x-nodiscard.c
clang/test/Sema/diagnose_if.c
clang/test/Sema/implicit-decl-c90.c
clang/test/Sema/varargs-x86-64.c
clang/test/Sema/varargs.c
clang/test/Sema/zero_call_used_regs.c
clang/test/SemaObjC/attr-called-once.m
clang/test/SemaObjC/cocoa-api-usage.m
Removed:
################################################################################
diff --git a/clang/test/AST/ast-dump-expr-json.m b/clang/test/AST/ast-dump-expr-json.m
index 824de5bffc491..bbde4451f9fe3 100644
--- a/clang/test/AST/ast-dump-expr-json.m
+++ b/clang/test/AST/ast-dump-expr-json.m
@@ -51,7 +51,7 @@ - (id)objectAtIndexedSubscript:(int)index;
- (void)setObject:(id)object atIndexedSubscript:(int)index;
@end
-void TestObjCEncode() {
+void TestObjCEncode(void) {
@encode(int);
@encode(typeof(^{;}));
}
@@ -61,11 +61,11 @@ void TestObjCMessage(I *Obj) {
[I method2];
}
-void TestObjCBoxed() {
+void TestObjCBoxed(void) {
@(1 + 1);
}
-void TestObjCSelector() {
+void TestObjCSelector(void) {
SEL s = @selector(dealloc);
}
@@ -90,7 +90,7 @@ void TestObjCIVarRef(I *Ptr) {
Ptr->public = 0;
}
-void TestObjCBoolLiteral() {
+void TestObjCBoolLiteral(void) {
__objc_yes;
__objc_no;
}
@@ -123,7 +123,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "name": "TestObjCEncode",
// CHECK-NEXT: "mangledName": "TestObjCEncode",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@@ -133,7 +133,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 54,
-// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
@@ -450,7 +450,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "name": "TestObjCBoxed",
// CHECK-NEXT: "mangledName": "TestObjCBoxed",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@@ -460,7 +460,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
@@ -613,7 +613,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "name": "TestObjCSelector",
// CHECK-NEXT: "mangledName": "TestObjCSelector",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@@ -623,7 +623,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 68,
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
@@ -4997,7 +4997,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "name": "TestObjCBoolLiteral",
// CHECK-NEXT: "mangledName": "TestObjCBoolLiteral",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@@ -5007,7 +5007,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 93,
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
diff --git a/clang/test/AST/ast-dump-stmt-json.c b/clang/test/AST/ast-dump-stmt-json.c
index 9eeefcb3b8058..a7f5648b8075f 100644
--- a/clang/test/AST/ast-dump-stmt-json.c
+++ b/clang/test/AST/ast-dump-stmt-json.c
@@ -3,7 +3,7 @@
int TestLocation = 0;
int TestIndent = 1 + (1);
-void TestDeclStmt() {
+void TestDeclStmt(void) {
int x = 0;
int y, z;
}
@@ -332,7 +332,7 @@ void TestVLA(int n) {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 6,
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
diff --git a/clang/test/AST/ast-dump-stmt-json.m b/clang/test/AST/ast-dump-stmt-json.m
index 5ad1040d01348..096b9c3900d36 100644
--- a/clang/test/AST/ast-dump-stmt-json.m
+++ b/clang/test/AST/ast-dump-stmt-json.m
@@ -11,7 +11,7 @@ void TestExprWithCleanup(int x) {
@interface A
@end
-void TestObjCAtCatchStmt() {
+void TestObjCAtCatchStmt(void) {
@try {
} @catch(A *a) {
} @catch(...) {
@@ -513,7 +513,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "name": "TestObjCAtCatchStmt",
// CHECK-NEXT: "mangledName": "TestObjCAtCatchStmt",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
@@ -523,7 +523,7 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "offset": {{[0-9]+}},
// CHECK-NEXT: "line": 14,
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
diff --git a/clang/test/Analysis/OSAtomic_mac.c b/clang/test/Analysis/OSAtomic_mac.c
index 272aada712e3d..4e07105a035cc 100644
--- a/clang/test/Analysis/OSAtomic_mac.c
+++ b/clang/test/Analysis/OSAtomic_mac.c
@@ -1,8 +1,8 @@
// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-output=text -verify %s
-int OSAtomicCompareAndSwapPtrBarrier(*, *, **);
-int OSAtomicCompareAndSwapPtrBarrier() {
+int OSAtomicCompareAndSwapPtrBarrier(void *, void *, void **);
+int OSAtomicCompareAndSwapPtrBarrier(void *, void *, void **) {
// There is some body in the actual header,
// but we should trust our BodyFarm instead.
}
diff --git a/clang/test/CodeGen/2005-02-27-MarkGlobalConstant.c b/clang/test/CodeGen/2005-02-27-MarkGlobalConstant.c
index 7cf15375e5a18..9028a5abf9e67 100644
--- a/clang/test/CodeGen/2005-02-27-MarkGlobalConstant.c
+++ b/clang/test/CodeGen/2005-02-27-MarkGlobalConstant.c
@@ -4,7 +4,7 @@
// The synthetic global made by the CFE for big initializer should be marked
// constant.
-void bar();
+void bar(char *);
void foo(void) {
// CHECK: private unnamed_addr constant
char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
diff --git a/clang/test/CodeGen/2010-07-14-ref-off-end.c b/clang/test/CodeGen/2010-07-14-ref-off-end.c
index 5ef4076af8fa9..5a525d160ad2e 100644
--- a/clang/test/CodeGen/2010-07-14-ref-off-end.c
+++ b/clang/test/CodeGen/2010-07-14-ref-off-end.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 %s -emit-llvm -triple i386-apple-darwin -o - | FileCheck %s
-extern void abort();
+extern void abort(void);
extern void exit(int);
struct T
{
@@ -12,7 +12,7 @@ struct T s[1];
s[0]=t;
return(char)s->c;
}
-main()
+main(void)
{
// CHECK: getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0
// CHECK: getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0
diff --git a/clang/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp b/clang/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
index e5fe98263a165..2e98a1140900b 100644
--- a/clang/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
+++ b/clang/test/CodeGen/Inputs/debug-info-file-checksum-line.cpp
@@ -3,7 +3,7 @@ int foo(int x) {
}
#line 100
-void test1() {}
+void test1(void) {}
#line 200
-void test2() {}
+void test2(void) {}
diff --git a/clang/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp b/clang/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
index 11029e6b7a549..ade9f1655ffd2 100644
--- a/clang/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
+++ b/clang/test/CodeGen/Inputs/debug-info-file-checksum-pre.cpp
@@ -1,9 +1,9 @@
#line 1 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
#line 1 "f:\\svn\\clang\\test\\codegen\\inputs\\code-coverage-filter1.h"
-void test1() {}
+void test1(void) {}
#line 2 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
#line 1 "f:\\svn\\clang\\test\\codegen\\inputs\\code-coverage-filter2.h"
-void test2() {}
+void test2(void) {}
#line 3 "F:\\svn\\clang\\test\\CodeGen\\Inputs\\debug-info-file-checksum.c"
int foo(int x) {
return x+1;
diff --git a/clang/test/CodeGen/X86/fp-eval-method.c b/clang/test/CodeGen/X86/fp-eval-method.c
index 5bfc3701050f5..d74f88b9fe255 100644
--- a/clang/test/CodeGen/X86/fp-eval-method.c
+++ b/clang/test/CodeGen/X86/fp-eval-method.c
@@ -13,7 +13,7 @@ float f(float x, float y) {
return 2.0f + x + y;
}
-int getEvalMethod() {
+int getEvalMethod(void) {
// CHECK: ret i32 1
// CHECK-EXT: ret i32 2
return __FLT_EVAL_METHOD__;
diff --git a/clang/test/CodeGen/block-copy.c b/clang/test/CodeGen/block-copy.c
index 0d25ebb46aa78..4679fe19b78f8 100644
--- a/clang/test/CodeGen/block-copy.c
+++ b/clang/test/CodeGen/block-copy.c
@@ -4,7 +4,7 @@
-void foo();
+void foo(float *);
float bar(void) {
float lookupTable[] = {-1,-1,-1,0, -1,-1,0,-1, -1,-1,0,1, -1,-1,1,0,
diff --git a/clang/test/CodeGen/block-with-perdefinedexpr.c b/clang/test/CodeGen/block-with-perdefinedexpr.c
index b9af9c1b04181..fb56771529747 100644
--- a/clang/test/CodeGen/block-with-perdefinedexpr.c
+++ b/clang/test/CodeGen/block-with-perdefinedexpr.c
@@ -3,12 +3,12 @@
void syslog(const char *, ...);
-void handler( );
+void handler(void(^)(void));
__attribute__((used))
static void (^spd)(void) = ^(void)
{
- handler( ^(){ syslog("%s", __FUNCTION__); } );
+ handler( ^(void){ syslog("%s", __FUNCTION__); } );
};
// CHECK: @__FUNCTION__.spd_block_invoke_2 = private unnamed_addr constant [19 x i8] c"spd_block_invoke_2\00"
// CHECK: define internal void @spd_block_invoke_2
diff --git a/clang/test/CodeGen/debug-info-block-out-return.c b/clang/test/CodeGen/debug-info-block-out-return.c
index 931ea64d13833..cae1688f16112 100644
--- a/clang/test/CodeGen/debug-info-block-out-return.c
+++ b/clang/test/CodeGen/debug-info-block-out-return.c
@@ -19,7 +19,7 @@
// above)
#line 1
typedef struct { int array[12]; } BigStruct_t;
-BigStruct_t (^a)() = ^(int param) {
+BigStruct_t (^a)(int) = ^(int param) {
BigStruct_t b;
return b;
};
diff --git a/clang/test/CodeGen/debug-info-file-checksum.c b/clang/test/CodeGen/debug-info-file-checksum.c
index 273a10b067811..d9e94c5da35b1 100644
--- a/clang/test/CodeGen/debug-info-file-checksum.c
+++ b/clang/test/CodeGen/debug-info-file-checksum.c
@@ -15,4 +15,4 @@
// Ensure #line directives without name do emit checksums
// RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum-line.cpp -o - | FileCheck %s --check-prefix CHECKSUM
-// CHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum-line.cpp", directory:{{.*}}, checksumkind: CSK_MD5, checksum: "7b568574d0e3c56c28e5e0234d1f4a06")
+// CHECKSUM: !DIFile(filename: "{{.*}}debug-info-file-checksum-line.cpp", directory:{{.*}}, checksumkind: CSK_MD5, checksum: "e13bca9b34ed822d596a519c9ce60995")
diff --git a/clang/test/CodeGen/merge-attrs.c b/clang/test/CodeGen/merge-attrs.c
index 0a606add556a7..0758174d64f8f 100644
--- a/clang/test/CodeGen/merge-attrs.c
+++ b/clang/test/CodeGen/merge-attrs.c
@@ -2,7 +2,7 @@
void *malloc(__SIZE_TYPE__ size) __attribute__ ((__nothrow__));
-inline static void __zend_malloc() {
+inline static void __zend_malloc(int) {
malloc(1);
}
diff --git a/clang/test/CodeGen/sret2.c b/clang/test/CodeGen/sret2.c
index 0e254ed914a48..5f1f6f0620965 100644
--- a/clang/test/CodeGen/sret2.c
+++ b/clang/test/CodeGen/sret2.c
@@ -8,4 +8,4 @@ struct abc {
long e;
};
-struct abc foo2(){}
+struct abc foo2(void){}
diff --git a/clang/test/CodeGenObjC/Inputs/nsvalue-boxed-expressions-support.h b/clang/test/CodeGenObjC/Inputs/nsvalue-boxed-expressions-support.h
index cbcf882b27e35..1d34be1e86cc5 100644
--- a/clang/test/CodeGenObjC/Inputs/nsvalue-boxed-expressions-support.h
+++ b/clang/test/CodeGenObjC/Inputs/nsvalue-boxed-expressions-support.h
@@ -58,6 +58,6 @@ typedef struct BOXABLE NSEdgeInsets NSEdgeInsets;
@end
-NSRange getRange();
+NSRange getRange(void);
#endif // NSVALUE_BOXED_EXPRESSIONS_SUPPORT_H
diff --git a/clang/test/CodeGenObjC/arc-blocks.m b/clang/test/CodeGenObjC/arc-blocks.m
index 81ea33a0b7e74..1cb194828e141 100644
--- a/clang/test/CodeGenObjC/arc-blocks.m
+++ b/clang/test/CodeGenObjC/arc-blocks.m
@@ -727,7 +727,7 @@ void test19(void (^b)(void)) {
// CHECK-UNOPT: store i8* [[RETAINED]], i8** [[BLOCKCAPTURED]]
// CHECK-UNOPT: call void @llvm.objc.storeStrong(i8** [[BLOCKCAPTURED]], i8* null)
-void test20_callee(void (^)());
+void test20_callee(void (^)(void));
void test20(const id x) {
test20_callee(^{ (void)x; });
}
diff --git a/clang/test/CodeGenObjC/interface.m b/clang/test/CodeGenObjC/interface.m
index 4adc926141b2e..c3a4b375e0ca0 100644
--- a/clang/test/CodeGenObjC/interface.m
+++ b/clang/test/CodeGenObjC/interface.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -O3 -emit-llvm -o %t %s
// RUN: grep 'ret i32 385' %t
-void *alloca();
+void *alloca(unsigned);
@interface I0 {
@public
diff --git a/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m b/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
index 6e45e94b8834e..a324c00390d11 100644
--- a/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
+++ b/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
@@ -13,7 +13,7 @@
// CHECK: [[EDGE_STR:.*]] = {{.*}}NSEdgeInsets=dddd{{.*}}
// CHECK-LABEL: define{{.*}} void @doRange()
-void doRange() {
+void doRange(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -32,7 +32,7 @@ void doRange() {
}
// CHECK-LABEL: define{{.*}} void @doPoint()
-void doPoint() {
+void doPoint(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGPoint{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGPoint{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -51,7 +51,7 @@ void doPoint() {
}
// CHECK-LABEL: define{{.*}} void @doSize()
-void doSize() {
+void doSize(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGSize{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGSize{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -70,7 +70,7 @@ void doSize() {
}
// CHECK-LABEL: define{{.*}} void @doRect()
-void doRect() {
+void doRect(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGRect{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGRect{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -91,7 +91,7 @@ void doRect() {
}
// CHECK-LABEL: define{{.*}} void @doNSEdgeInsets()
-void doNSEdgeInsets() {
+void doNSEdgeInsets(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -110,10 +110,10 @@ void doNSEdgeInsets() {
}
// CHECK-LABEL: define{{.*}} void @doRangeRValue()
-void doRangeRValue() {
+void doRangeRValue(void) {
// CHECK: [[COERCE:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
- // CHECK: call {{.*}} @getRange {{.*}} [[COERCE]]{{.*}}
+ // CHECK: call {{.*}} @getRange({{.*}} [[COERCE]])
// CHECK: [[COERCE_CAST:%.*]] = bitcast %struct._NSRange* [[COERCE]]{{.*}}
// CHECK: [[RECV:%.*]] = bitcast %struct._class_t* [[RECV_PTR]] to i8*
// CHECK: [[SEL:%.*]] = load i8*, i8** [[VALUE_SEL]]
diff --git a/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m b/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m
index c7688f8a5696a..d3caa5f463743 100644
--- a/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m
+++ b/clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m
@@ -13,7 +13,7 @@
// CHECK: [[EDGE_STR:.*]] = {{.*}}NSEdgeInsets=dddd{{.*}}
// CHECK-LABEL: define{{.*}} void @doRange()
-void doRange() {
+void doRange(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -30,7 +30,7 @@ void doRange() {
}
// CHECK-LABEL: define{{.*}} void @doPoint()
-void doPoint() {
+void doPoint(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGPoint{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGPoint{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -47,7 +47,7 @@ void doPoint() {
}
// CHECK-LABEL: define{{.*}} void @doSize()
-void doSize() {
+void doSize(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGSize{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGSize{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -64,7 +64,7 @@ void doSize() {
}
// CHECK-LABEL: define{{.*}} void @doRect()
-void doRect() {
+void doRect(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.CGRect{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.CGRect{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -83,7 +83,7 @@ void doRect() {
}
// CHECK-LABEL: define{{.*}} void @doNSEdgeInsets()
-void doNSEdgeInsets() {
+void doNSEdgeInsets(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -100,10 +100,10 @@ void doNSEdgeInsets() {
}
// CHECK-LABEL: define{{.*}} void @doRangeRValue()
-void doRangeRValue() {
+void doRangeRValue(void) {
// CHECK: [[COERCE:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
- // CHECK: call {{.*}} @getRange {{.*}} [[COERCE]]{{.*}}
+ // CHECK: call {{.*}} @getRange({{.*}} [[COERCE]])
// CHECK: [[COERCE_CAST:%.*]] = bitcast %struct._NSRange* [[COERCE]]{{.*}}
// CHECK: [[RECV:%.*]] = bitcast %struct._class_t* [[RECV_PTR]] to i8*
// CHECK: [[SEL:%.*]] = load i8*, i8** [[VALUE_SEL]]
diff --git a/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m b/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
index cc8b1cbea3222..573dfa3bf87d1 100644
--- a/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
+++ b/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
@@ -13,7 +13,7 @@
// CHECK: [[EDGE_STR:.*]] = {{.*}}NSEdgeInsets=dddd{{.*}}
// CHECK-LABEL: define{{.*}} void @doRange()
-void doRange() {
+void doRange(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -31,7 +31,7 @@ void doRange() {
}
// CHECK-LABEL: define{{.*}} void @doPoint()
-void doPoint() {
+void doPoint(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSPoint{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSPoint{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -49,7 +49,7 @@ void doPoint() {
}
// CHECK-LABEL: define{{.*}} void @doSize()
-void doSize() {
+void doSize(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSSize{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSSize{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -67,7 +67,7 @@ void doSize() {
}
// CHECK-LABEL: define{{.*}} void @doRect()
-void doRect() {
+void doRect(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRect{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRect{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -87,7 +87,7 @@ void doRect() {
}
// CHECK-LABEL: define{{.*}} void @doNSEdgeInsets()
-void doNSEdgeInsets() {
+void doNSEdgeInsets(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -105,7 +105,7 @@ void doNSEdgeInsets() {
}
// CHECK-LABEL: define{{.*}} void @doRangeRValue()
-void doRangeRValue() {
+void doRangeRValue(void) {
// CHECK: [[COERCE:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
// CHECK: [[RVAL:%.*]] = call {{.*}} @getRange()
diff --git a/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m b/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m
index d30ad1056c644..9a100b52888dd 100644
--- a/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m
+++ b/clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m
@@ -13,7 +13,7 @@
// CHECK: [[EDGE_STR:.*]] = {{.*}}NSEdgeInsets=dddd{{.*}}
// CHECK-LABEL: define{{.*}} void @doRange()
-void doRange() {
+void doRange(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -30,7 +30,7 @@ void doRange() {
}
// CHECK-LABEL: define{{.*}} void @doPoint()
-void doPoint() {
+void doPoint(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSPoint{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSPoint{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -47,7 +47,7 @@ void doPoint() {
}
// CHECK-LABEL: define{{.*}} void @doSize()
-void doSize() {
+void doSize(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSSize{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSSize{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -64,7 +64,7 @@ void doSize() {
}
// CHECK-LABEL: define{{.*}} void @doRect()
-void doRect() {
+void doRect(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct._NSRect{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct._NSRect{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -83,7 +83,7 @@ void doRect() {
}
// CHECK-LABEL: define{{.*}} void @doNSEdgeInsets()
-void doNSEdgeInsets() {
+void doNSEdgeInsets(void) {
// CHECK: [[LOCAL_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[TEMP_VAR:%.*]] = alloca %struct.NSEdgeInsets{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
@@ -100,7 +100,7 @@ void doNSEdgeInsets() {
}
// CHECK-LABEL: define{{.*}} void @doRangeRValue()
-void doRangeRValue() {
+void doRangeRValue(void) {
// CHECK: [[COERCE:%.*]] = alloca %struct._NSRange{{.*}}
// CHECK: [[RECV_PTR:%.*]] = load {{.*}} [[NSVALUE]]
// CHECK: [[RVAL:%.*]] = call {{.*}} @getRange()
diff --git a/clang/test/Sema/Inputs/diagnose-if-warn-system-header.h b/clang/test/Sema/Inputs/diagnose-if-warn-system-header.h
index 753c69d4b5328..5183d785e5cb9 100644
--- a/clang/test/Sema/Inputs/diagnose-if-warn-system-header.h
+++ b/clang/test/Sema/Inputs/diagnose-if-warn-system-header.h
@@ -6,6 +6,6 @@ inline int system_header_func(int x)
return 0;
}
-void test_system_header() {
+void test_system_header(void) {
system_header_func(0); // expected-warning {{system header warning}}
}
diff --git a/clang/test/Sema/c2x-nodiscard.c b/clang/test/Sema/c2x-nodiscard.c
index 812421757d347..fb38e20d8d7aa 100644
--- a/clang/test/Sema/c2x-nodiscard.c
+++ b/clang/test/Sema/c2x-nodiscard.c
@@ -25,7 +25,7 @@ struct S4 get_s(void);
enum [[nodiscard]] E2 { Two };
enum E2 get_e(void);
-[[nodiscard]] int get_i();
+[[nodiscard]] int get_i(void);
void f2(void) {
get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
diff --git a/clang/test/Sema/diagnose_if.c b/clang/test/Sema/diagnose_if.c
index 00bb4770f053a..6297545781f90 100644
--- a/clang/test/Sema/diagnose_if.c
+++ b/clang/test/Sema/diagnose_if.c
@@ -2,26 +2,26 @@
#define _diagnose_if(...) __attribute__((diagnose_if(__VA_ARGS__)))
-void failure() _diagnose_if(); // expected-error{{exactly 3 arguments}}
-void failure() _diagnose_if(0); // expected-error{{exactly 3 arguments}}
-void failure() _diagnose_if(0, ""); // expected-error{{exactly 3 arguments}}
-void failure() _diagnose_if(0, "", "error", 1); // expected-error{{exactly 3 arguments}}
-void failure() _diagnose_if(0, 0, "error"); // expected-error{{requires a string}}
-void failure() _diagnose_if(0, "", "invalid"); // expected-error{{invalid diagnostic type for 'diagnose_if'; use "error" or "warning" instead}}
-void failure() _diagnose_if(0, "", "ERROR"); // expected-error{{invalid diagnostic type}}
-void failure(int a) _diagnose_if(a, "", ""); // expected-error{{invalid diagnostic type}}
-void failure() _diagnose_if(a, "", ""); // expected-error{{undeclared identifier 'a'}}
+void failure1(void) _diagnose_if(); // expected-error{{exactly 3 arguments}}
+void failure2(void) _diagnose_if(0); // expected-error{{exactly 3 arguments}}
+void failure3(void) _diagnose_if(0, ""); // expected-error{{exactly 3 arguments}}
+void failure4(void) _diagnose_if(0, "", "error", 1); // expected-error{{exactly 3 arguments}}
+void failure5(void) _diagnose_if(0, 0, "error"); // expected-error{{requires a string}}
+void failure6(void) _diagnose_if(0, "", "invalid"); // expected-error{{invalid diagnostic type for 'diagnose_if'; use "error" or "warning" instead}}
+void failure7(void) _diagnose_if(0, "", "ERROR"); // expected-error{{invalid diagnostic type}}
+void failure8(int a) _diagnose_if(a, "", ""); // expected-error{{invalid diagnostic type}}
+void failure9(void) _diagnose_if(a, "", ""); // expected-error{{undeclared identifier 'a'}}
int globalVar;
-void never_constant() _diagnose_if(globalVar, "", "error"); // expected-error{{'diagnose_if' attribute expression never produces a constant expression}} expected-note{{subexpression not valid}}
-void never_constant() _diagnose_if(globalVar, "", "warning"); // expected-error{{'diagnose_if' attribute expression never produces a constant expression}} expected-note{{subexpression not valid}}
+void never_constant(void) _diagnose_if(globalVar, "", "error"); // expected-error{{'diagnose_if' attribute expression never produces a constant expression}} expected-note{{subexpression not valid}}
+void never_constant(void) _diagnose_if(globalVar, "", "warning"); // expected-error{{'diagnose_if' attribute expression never produces a constant expression}} expected-note{{subexpression not valid}}
int alwaysok(int q) _diagnose_if(0, "", "error");
int neverok(int q) _diagnose_if(1, "oh no", "error"); // expected-note 5{{from 'diagnose_if' attribute on 'neverok'}}
int alwayswarn(int q) _diagnose_if(1, "oh no", "warning"); // expected-note 5{{from 'diagnose_if' attribute}}
int neverwarn(int q) _diagnose_if(0, "", "warning");
-void runConstant() {
+void runConstant(void) {
int m;
alwaysok(0);
alwaysok(1);
@@ -58,7 +58,7 @@ void runConstant() {
}
int abs(int q) _diagnose_if(q >= 0, "redundant abs call", "error"); //expected-note{{from 'diagnose_if'}}
-void runVariable() {
+void runVariable(void) {
int m;
abs(-1);
abs(1); // expected-error{{redundant abs call}}
@@ -75,18 +75,18 @@ int ovl1(void *m) _overloadable;
int ovl2(const char *n) _overloadable _diagnose_if(n, "oh no", "error"); // expected-note{{candidate function}}
int ovl2(char *m) _overloadable; // expected-note{{candidate function}}
-void overloadsYay() {
+void overloadsYay(void) {
ovl1((void *)0);
ovl1(""); // expected-error{{oh no}}
ovl2((void *)0); // expected-error{{ambiguous}}
}
-void errorWarnDiagnose1() _diagnose_if(1, "oh no", "error") // expected-note{{from 'diagnose_if'}}
+void errorWarnDiagnose1(void) _diagnose_if(1, "oh no", "error") // expected-note{{from 'diagnose_if'}}
_diagnose_if(1, "nop", "warning");
-void errorWarnDiagnose2() _diagnose_if(1, "oh no", "error") // expected-note{{from 'diagnose_if'}}
+void errorWarnDiagnose2(void) _diagnose_if(1, "oh no", "error") // expected-note{{from 'diagnose_if'}}
_diagnose_if(1, "nop", "error");
-void errorWarnDiagnose3() _diagnose_if(1, "nop", "warning")
+void errorWarnDiagnose3(void) _diagnose_if(1, "nop", "warning")
_diagnose_if(1, "oh no", "error"); // expected-note{{from 'diagnose_if'}}
void errorWarnDiagnoseArg1(int a) _diagnose_if(a == 1, "oh no", "error") // expected-note{{from 'diagnose_if'}}
@@ -96,7 +96,7 @@ void errorWarnDiagnoseArg2(int a) _diagnose_if(a == 1, "oh no", "error") // expe
void errorWarnDiagnoseArg3(int a) _diagnose_if(a == 1, "nop", "warning")
_diagnose_if(a == 1, "oh no", "error"); // expected-note{{from 'diagnose_if'}}
-void runErrorWarnDiagnose() {
+void runErrorWarnDiagnose(void) {
errorWarnDiagnose1(); // expected-error{{oh no}}
errorWarnDiagnose2(); // expected-error{{oh no}}
errorWarnDiagnose3(); // expected-error{{oh no}}
@@ -106,18 +106,18 @@ void runErrorWarnDiagnose() {
errorWarnDiagnoseArg3(1); // expected-error{{oh no}}
}
-void warnWarnDiagnose() _diagnose_if(1, "oh no!", "warning") _diagnose_if(1, "foo", "warning"); // expected-note 2{{from 'diagnose_if'}}
-void runWarnWarnDiagnose() {
+void warnWarnDiagnose(void) _diagnose_if(1, "oh no!", "warning") _diagnose_if(1, "foo", "warning"); // expected-note 2{{from 'diagnose_if'}}
+void runWarnWarnDiagnose(void) {
warnWarnDiagnose(); // expected-warning{{oh no!}} expected-warning{{foo}}
}
void declsStackErr1(int a) _diagnose_if(a & 1, "decl1", "error"); // expected-note 2{{from 'diagnose_if'}}
void declsStackErr1(int a) _diagnose_if(a & 2, "decl2", "error"); // expected-note{{from 'diagnose_if'}}
-void declsStackErr2();
-void declsStackErr2() _diagnose_if(1, "complaint", "error"); // expected-note{{from 'diagnose_if'}}
-void declsStackErr3() _diagnose_if(1, "complaint", "error"); // expected-note{{from 'diagnose_if'}}
-void declsStackErr3();
-void runDeclsStackErr() {
+void declsStackErr2(void);
+void declsStackErr2(void) _diagnose_if(1, "complaint", "error"); // expected-note{{from 'diagnose_if'}}
+void declsStackErr3(void) _diagnose_if(1, "complaint", "error"); // expected-note{{from 'diagnose_if'}}
+void declsStackErr3(void);
+void runDeclsStackErr(void) {
declsStackErr1(0);
declsStackErr1(1); // expected-error{{decl1}}
declsStackErr1(2); // expected-error{{decl2}}
@@ -128,11 +128,11 @@ void runDeclsStackErr() {
void declsStackWarn1(int a) _diagnose_if(a & 1, "decl1", "warning"); // expected-note 2{{from 'diagnose_if'}}
void declsStackWarn1(int a) _diagnose_if(a & 2, "decl2", "warning"); // expected-note 2{{from 'diagnose_if'}}
-void declsStackWarn2();
-void declsStackWarn2() _diagnose_if(1, "complaint", "warning"); // expected-note{{from 'diagnose_if'}}
-void declsStackWarn3() _diagnose_if(1, "complaint", "warning"); // expected-note{{from 'diagnose_if'}}
-void declsStackWarn3();
-void runDeclsStackWarn() {
+void declsStackWarn2(void);
+void declsStackWarn2(void) _diagnose_if(1, "complaint", "warning"); // expected-note{{from 'diagnose_if'}}
+void declsStackWarn3(void) _diagnose_if(1, "complaint", "warning"); // expected-note{{from 'diagnose_if'}}
+void declsStackWarn3(void);
+void runDeclsStackWarn(void) {
declsStackWarn1(0);
declsStackWarn1(1); // expected-warning{{decl1}}
declsStackWarn1(2); // expected-warning{{decl2}}
@@ -142,7 +142,7 @@ void runDeclsStackWarn() {
}
void noMsg(int n) _diagnose_if(n, "", "warning"); // expected-note{{from 'diagnose_if'}}
-void runNoMsg() {
+void runNoMsg(void) {
noMsg(1); // expected-warning{{<no message provided>}}
}
@@ -161,7 +161,7 @@ void underbarName(int a) __attribute__((__diagnose_if__(a, "", "warning")));
// PR38095
void constCharStar(const char *str) __attribute__((__diagnose_if__(!str[0], "empty string not allowed", "error"))); // expected-note {{from}}
void charStar(char *str) __attribute__((__diagnose_if__(!str[0], "empty string not allowed", "error"))); // expected-note {{from}}
-void runConstCharStar() {
+void runConstCharStar(void) {
constCharStar("foo");
charStar("bar");
constCharStar(""); // expected-error {{empty string not allowed}}
diff --git a/clang/test/Sema/implicit-decl-c90.c b/clang/test/Sema/implicit-decl-c90.c
index 6b3491cff7cfa..3950e73d1f5c6 100644
--- a/clang/test/Sema/implicit-decl-c90.c
+++ b/clang/test/Sema/implicit-decl-c90.c
@@ -1,19 +1,19 @@
// RUN: %clang_cc1 %s -std=c90 -verify -fsyntax-only
void t0(int x) {
- int explicit_decl();
- int (*p)();
+ int explicit_decl(void);
+ int (*p)(void);
if(x > 0)
x = g() + 1; // expected-note {{previous implicit declaration}}
p = g;
if(x < 0) {
extern void u(int (*)[h()]);
- int (*q)() = h;
+ int (*q)(void) = h;
}
p = h; /* expected-error {{use of undeclared identifier 'h'}} */
}
void t1(int x) {
- int (*p)();
+ int (*p)(void);
switch (x) {
g();
case 0:
@@ -32,11 +32,11 @@ void t1(int x) {
int t2(int x) {
int y = ({ if (x > 0) x = g() + 1; 2*x; });
- int (*p)() = g; /* expected-error {{use of undeclared identifier 'g'}} */
+ int (*p)(void) = g; /* expected-error {{use of undeclared identifier 'g'}} */
return y;
}
-int PR34822() {
+int PR34822(void) {
{int i = sizeof(PR34822_foo());} /* expected-note {{previous definition is here}} */
{extern int PR34822_foo;} /* expected-error {{redefinition of 'PR34822_foo' as
diff erent kind of symbol}} */
@@ -44,7 +44,7 @@ int PR34822() {
{int i = sizeof(PR34822_bar());} /* expected-warning {{use of out-of-scope declaration of 'PR34822_bar' whose type is not compatible with that of an implicit declaration}} expected-error {{called object type 'int' is not a function or function pointer}} */
}
-int (*p)() = g; /* expected-error {{use of undeclared identifier 'g'}} */
-int (*q)() = h; /* expected-error {{use of undeclared identifier 'h'}} */
+int (*p)(void) = g; /* expected-error {{use of undeclared identifier 'g'}} */
+int (*q)(void) = h; /* expected-error {{use of undeclared identifier 'h'}} */
-float g(); /* expected-error {{conflicting types for 'g'}} */
+float g(void); /* expected-error {{conflicting types for 'g'}} */
diff --git a/clang/test/Sema/varargs-x86-64.c b/clang/test/Sema/varargs-x86-64.c
index 0929c0d914787..12d4620ecaf7f 100644
--- a/clang/test/Sema/varargs-x86-64.c
+++ b/clang/test/Sema/varargs-x86-64.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-apple-darwin9
// rdar://6726818
-void f1() {
+void f1(void) {
const __builtin_va_list args2;
(void)__builtin_va_arg(args2, int); // expected-error {{first argument to 'va_arg' is of type 'const __builtin_va_list' and not 'va_list'}}
}
@@ -33,7 +33,7 @@ void __attribute__((ms_abi)) g3(float a, ...) { // expected-note 2{{parameter of
__builtin_ms_va_start(ap, (a)); // expected-warning {{passing an object that undergoes default argument promotion to 'va_start' has undefined behavior}}
}
-void __attribute__((ms_abi)) g5() {
+void __attribute__((ms_abi)) g5(void) {
__builtin_ms_va_list ap;
__builtin_ms_va_start(ap, ap); // expected-error {{'va_start' used in function with fixed args}}
}
diff --git a/clang/test/Sema/varargs.c b/clang/test/Sema/varargs.c
index 3fa429163ff5b..fee323560623a 100644
--- a/clang/test/Sema/varargs.c
+++ b/clang/test/Sema/varargs.c
@@ -34,7 +34,7 @@ void f4(const char *msg, ...) {
__builtin_va_end (ap);
}
-void f5() {
+void f5(void) {
__builtin_va_list ap;
__builtin_va_start(ap,ap); // expected-error {{'va_start' used in function with fixed args}}
}
diff --git a/clang/test/Sema/zero_call_used_regs.c b/clang/test/Sema/zero_call_used_regs.c
index dc929797694b6..3313707f97cf9 100644
--- a/clang/test/Sema/zero_call_used_regs.c
+++ b/clang/test/Sema/zero_call_used_regs.c
@@ -2,17 +2,17 @@
#define _zero_call_used_regs(...) __attribute__((zero_call_used_regs(__VA_ARGS__)))
-void failure() _zero_call_used_regs(); // expected-error {{takes one argument}}
-void failure() _zero_call_used_regs("used", "used-gpr"); // expected-error {{takes one argument}}
-void failure() _zero_call_used_regs(0); // expected-error {{requires a string}}
-void failure() _zero_call_used_regs("hello"); // expected-warning {{argument not supported: hello}}
+void failure1(void) _zero_call_used_regs(); // expected-error {{takes one argument}}
+void failure2(void) _zero_call_used_regs("used", "used-gpr"); // expected-error {{takes one argument}}
+void failure3(void) _zero_call_used_regs(0); // expected-error {{requires a string}}
+void failure4(void) _zero_call_used_regs("hello"); // expected-warning {{argument not supported: hello}}
-void success() _zero_call_used_regs("skip");
-void success() _zero_call_used_regs("used-gpr-arg");
-void success() _zero_call_used_regs("used-gpr");
-void success() _zero_call_used_regs("used-arg");
-void success() _zero_call_used_regs("used");
-void success() _zero_call_used_regs("all-gpr-arg");
-void success() _zero_call_used_regs("all-gpr");
-void success() _zero_call_used_regs("all-arg");
-void success() _zero_call_used_regs("all");
+void success1(void) _zero_call_used_regs("skip");
+void success2(void) _zero_call_used_regs("used-gpr-arg");
+void success3(void) _zero_call_used_regs("used-gpr");
+void success4(void) _zero_call_used_regs("used-arg");
+void success5(void) _zero_call_used_regs("used");
+void success6(void) _zero_call_used_regs("all-gpr-arg");
+void success7(void) _zero_call_used_regs("all-gpr");
+void success8(void) _zero_call_used_regs("all-arg");
+void success9(void) _zero_call_used_regs("all");
diff --git a/clang/test/SemaObjC/attr-called-once.m b/clang/test/SemaObjC/attr-called-once.m
index 5112d0d3a2513..6f6b03ad6f7fc 100644
--- a/clang/test/SemaObjC/attr-called-once.m
+++ b/clang/test/SemaObjC/attr-called-once.m
@@ -5,16 +5,16 @@
void test1(int x CALLED_ONCE); // expected-error{{'called_once' attribute only applies to function-like parameters}}
void test2(double x CALLED_ONCE); // expected-error{{'called_once' attribute only applies to function-like parameters}}
-void test3(void (*foo)() CALLED_ONCE); // no-error
+void test3(void (*foo)(void) CALLED_ONCE); // no-error
void test4(int (^foo)(int) CALLED_ONCE); // no-error
-void test5(void (*foo)() __attribute__((called_once(1))));
+void test5(void (*foo)(void) __attribute__((called_once(1))));
// expected-error at -1{{'called_once' attribute takes no arguments}}
-void test6(void (*foo)() __attribute__((called_once("str1", "str2"))));
+void test6(void (*foo)(void) __attribute__((called_once("str1", "str2"))));
// expected-error at -1{{'called_once' attribute takes no arguments}}
-CALLED_ONCE void test7(); // expected-warning{{'called_once' attribute only applies to parameters}}
-void test8() {
- void (*foo)() CALLED_ONCE; // expected-warning{{'called_once' attribute only applies to parameters}}
+CALLED_ONCE void test7(void); // expected-warning{{'called_once' attribute only applies to parameters}}
+void test8(void) {
+ void (*foo)(void) CALLED_ONCE; // expected-warning{{'called_once' attribute only applies to parameters}}
foo();
}
diff --git a/clang/test/SemaObjC/cocoa-api-usage.m b/clang/test/SemaObjC/cocoa-api-usage.m
index bed7ecde06011..fd5f6cea71e4f 100644
--- a/clang/test/SemaObjC/cocoa-api-usage.m
+++ b/clang/test/SemaObjC/cocoa-api-usage.m
@@ -76,7 +76,7 @@ + (NSNumber *)numberWithInt:(int)value;
#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
#define TWO(x) ((x), (x))
-void foo() {
+void foo(void) {
NSString *str = M([NSString stringWithString:@"foo"]); // expected-warning {{redundant}}
str = [[NSString alloc] initWithString:@"foo"]; // expected-warning {{redundant}}
NSArray *arr = [NSArray arrayWithArray:@[str]]; // expected-warning {{redundant}}
More information about the cfe-commits
mailing list