aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-10-17 18:40:02 +0000
committerJohn McCall <rjmccall@apple.com>2011-10-17 18:40:02 +0000
commit5acb0c98b363400f6ade0ae7250f0102224e806b (patch)
tree2ae3fbf8345dac9706834b7e51f017e952e13490 /lib/Sema/SemaInit.cpp
parent0ddaeb9b031070ec64afe92d9892875ac44df427 (diff)
Teach the ARC compiler to not require __bridge casts when
passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index c566b236e4..f449c7d70d 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -2427,6 +2427,7 @@ bool InitializationSequence::isAmbiguous() const {
case FK_ArrayTypeMismatch:
case FK_NonConstantArrayInit:
case FK_ListInitializationFailed:
+ case FK_PlaceholderType:
return false;
case FK_ReferenceInitOverloadFailed:
@@ -3793,8 +3794,20 @@ InitializationSequence::InitializationSequence(Sema &S,
return;
}
Args[I] = Result.take();
+ } else if (const BuiltinType *PlaceholderTy
+ = Args[I]->getType()->getAsPlaceholderType()) {
+ // FIXME: should we be doing this here?
+ if (PlaceholderTy->getKind() != BuiltinType::Overload) {
+ ExprResult result = S.CheckPlaceholderExpr(Args[I]);
+ if (result.isInvalid()) {
+ SetFailed(FK_PlaceholderType);
+ return;
+ }
+ Args[I] = result.take();
+ }
}
+
QualType SourceType;
Expr *Initializer = 0;
if (NumArgs == 1) {
@@ -5200,6 +5213,11 @@ bool InitializationSequence::Diagnose(Sema &S,
"Inconsistent init list check result.");
break;
}
+
+ case FK_PlaceholderType: {
+ // FIXME: Already diagnosed!
+ break;
+ }
}
PrintInitLocationNote(S, Entity);
@@ -5297,6 +5315,11 @@ void InitializationSequence::dump(raw_ostream &OS) const {
case FK_ListInitializationFailed:
OS << "list initialization checker failure";
+ break;
+
+ case FK_PlaceholderType:
+ OS << "initializer expression isn't contextually valid";
+ break;
}
OS << '\n';
return;