Fix function to pointer conversion

This snippet is valid:
  void foo(void);
  ... foo + 42 ...
the function designator is converted to pointer to function
implicitely.  gen_op didn't do that and bailed out.
This commit is contained in:
Michael Matz
2016-07-14 04:09:49 +02:00
parent e034853b38
commit 662338f116
2 changed files with 20 additions and 0 deletions

View File

@@ -1847,6 +1847,7 @@ void funcptr_test()
int dummy;
void (*func)(int);
} st1;
long diff;
printf("funcptr:\n");
func = #
@@ -1862,6 +1863,12 @@ void funcptr_test()
printf("sizeof2 = %d\n", sizeof funcptr_test);
printf("sizeof3 = %d\n", sizeof(&funcptr_test));
printf("sizeof4 = %d\n", sizeof &funcptr_test);
a = 0;
func = num + a;
diff = func - num;
func(42);
(func + diff)(42);
(num + a)(43);
}
void lloptest(long long a, long long b)