diff options
Diffstat (limited to 'test/Analysis/retain-release.mm')
-rw-r--r-- | test/Analysis/retain-release.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Analysis/retain-release.mm b/test/Analysis/retain-release.mm index 01727ea64434..d92237b185a2 100644 --- a/test/Analysis/retain-release.mm +++ b/test/Analysis/retain-release.mm @@ -366,3 +366,22 @@ NSString * radar11152419(NSString *string1, NSString *key1, NSMapTable *map) { return string; } +//===----------------------------------------------------------------------===// +// Don't crash on non-member functions with "callbacks" but without names. +//===----------------------------------------------------------------------===// + +struct IntWrapper { + int arg; +}; + +int operator>> (const IntWrapper &W, int (*f)(int)) { + return f(W.arg); +} + +void testCallback() { + IntWrapper val = { 42 }; + + extern int process(int); + val >> process; +} + |