mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
This commit is contained in:
@@ -560,6 +560,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.EnableExperimentalUnavailableAsOptional |=
|
||||
Args.hasArg(OPT_enable_experimental_unavailable_as_optional);
|
||||
|
||||
Opts.EnableCFunctionPointers |=
|
||||
Args.hasArg(OPT_enable_c_function_pointers);
|
||||
|
||||
Opts.EnableCharacterLiterals |= Args.hasArg(OPT_enable_character_literals);
|
||||
Opts.UsePrivateDiscriminators |=
|
||||
Args.hasArg(OPT_enable_private_discriminators);
|
||||
|
||||
Reference in New Issue
Block a user