Commit Graph

7 Commits

Author SHA1 Message Date
Slava Pestov
3f6d881ad3 Sema: Diagnose @convention(c) conversions that capture generic parameters
Fixes <rdar://problem/22470105>.

Swift SVN r32162
2015-09-22 21:08:30 +00:00
Chris Willmore
1c3b391fd3 Don't allow function types that differ in SIL representation to be matched by SameType constraint.
<rdar://problem/22181714> Crash when typing "signal"

Swift SVN r31594
2015-09-01 01:46:59 +00:00
Joe Groff
55a830df38 ClangImporter: Remove -enable-c-function-pointers staging option.
Swift SVN r29764
2015-06-27 18:10:21 +00:00
Jordan Rose
d3eaad8334 Look through CaptureListExpr when checking C function pointer conversions.
This results in a more correct diagnostic being printed for closures with
capture lists, rather than claiming that they aren't literal closures.

Swift SVN r29058
2015-05-27 04:43:35 +00:00
Joe Groff
c0a2994564 AST: Start printing function types with @convention instead of old attributes.
And update tests to match.

Swift SVN r27262
2015-04-13 22:51:34 +00:00
Joe Groff
b03795e5f7 Add a '@convention(xxx)' attribute for specifying function conventions.
This is new attribute we're using to coalesce @thin, @objc_block, and @cc, and to extend to new uses like C function pointer types. Parse the new attribute, but preserve support for the old attributes, and print with the old attributes for now to separate out test changes. Migration fixits and test updates to come. I did take the opportunity here to kill off the '@cc(cdecl)' hack for AST-level function pointer types, which are now only spelt with @convention(c).

Swift SVN r27247
2015-04-13 04:27:02 +00:00
Joe Groff
94be8424ff Sema: Type checking for C function pointers.
Since a function pointer doesn't carry any context, we can only form a C function pointer from a static reference to a global function or a context-free local function or closure. (Or maybe a static function applied to its metatype, but that's not handled here yet.) As a placeholder for a to-be-bikeshedded surface syntax, let the existing @cc(cdecl) attribute appear in source text when the -enable-c-function-pointers frontend flag is passed.

Swift SVN r25308
2015-02-16 00:41:53 +00:00