mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Introduce intrinsic pointer argument conversions.
Add primitive type-checker rules for pointer arguments. An UnsafePointer argument accepts: - an UnsafePointer value of matching element type, or of any type if the argument is UnsafePointer<Void>, - an inout parameter of matching element type, or of any type if the argument is UnsafePointer<Void>, or - an inout Array parameter of matching element type, or of any type if the argument is UnsafePointer<Void>. A ConstUnsafePointer argument accepts: - an UnsafePointer, ConstUnsafePointer, or AutoreleasingUnsafePointer value of matching element type, or of any type if the argument is ConstUnsafePointer<Void>, - an inout parameter of matching element type, or of any type if the argument is ConstUnsafePointer<Void>, or - an inout or non-inout Array parameter of matching element type, or of any type if the argument is ConstUnsafePointer<Void>. An AutoreleasingUnsafePointer argument accepts: - an AutoreleasingUnsafePointer value of matching element type, or - an inout parameter of matching element type. This disrupts some error messages in unrelated tests, which is tracked by <rdar://problem/17380520>. Swift SVN r19008
This commit is contained in:
@@ -536,6 +536,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.EnableExperimentalPatterns |= Args.hasArg(OPT_enable_experimental_patterns);
|
||||
|
||||
Opts.EnablePointerConversions |= Args.hasArg(OPT_enable_pointer_conversions);
|
||||
|
||||
Opts.EnableCharacterLiterals |= Args.hasArg(OPT_enable_character_literals);
|
||||
|
||||
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
|
||||
|
||||
Reference in New Issue
Block a user