xref: /llvm-project/clang/test/Sema/pointer-subtract-compat.c (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
2 
3 typedef const char rchar;
a(char * a,rchar * b)4 int a(char* a, rchar* b) {
5   return a-b;
6 }
7 
f0(void (* fp)(void))8 void f0(void (*fp)(void)) {
9   int x = fp - fp; // expected-warning{{arithmetic on pointers to the function type 'void (void)' is a GNU extension}}
10 }
11