File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,24 @@ typedef int (*quux_t)(void) __cfi_salt("salt 'n");
4040typedef int (* quux_t )(void ) __cfi_salt ("pepper ");
4141 // expected-error@-1{{typedef redefinition with different type}}
4242
43- void func (int a ) __cfi_salt ("pepper ");
43+ void func1 (int a ) __cfi_salt ("pepper ");
4444 // expected-note@-1{{previous declaration is here}}
45- void func (int a ) { }
46- // expected-error@-1{{conflicting types for 'func'}}
45+ void func1 (int a ) { }
46+ // expected-error@-1{{conflicting types for 'func1'}}
47+ void (* fp1 )(int ) = func1 ;
48+ // expected-error@-1{{incompatible function pointer types initializing 'void (*)(int)' with an expression of type 'void (int)'}}
4749
4850void func2 (int ) [[clang ::cfi_salt ("test ")]];
51+ // expected-note@-1{{previous declaration is here}}
4952void func2 (int a ) { }
50- void (* fp )(int ) = func2 ;
53+ // expected-error@-1{{conflicting types for 'func2'}}
54+ void (* fp2 )(int ) = func2 ;
55+ // expected-error@-1{{incompatible function pointer types initializing 'void (*)(int)' with an expression of type 'void (int)'}}
56+
57+ void func3 (int ) __cfi_salt ("pepper "); // ok
58+ void func3 (int a ) __cfi_salt ("pepper ") { } // ok
59+ void (* __cfi_salt ("pepper ") fp3 )(int ) = func3 ; // ok
60+
61+ void func4 (int ) [[clang ::cfi_salt ("test ")]]; // ok
62+ void func4 (int a ) [[clang ::cfi_salt ("test ")]] { } // ok
63+ void (* [[clang ::cfi_salt ("test ")]] fp4 )(int ) = func4 ; // ok
You can’t perform that action at this time.
0 commit comments