aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-14 15:45:31 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-14 15:45:31 +0000
commit09f41cf63f4df0bf4e98ee473e44e9a95b68f0ff (patch)
treef1ffb0328649ff895b883f38966dee5e95262a89 /lib/Sema/SemaExpr.cpp
parentbe63802d1efe52697f49aafea49a5028b30b0aff (diff)
Introduce support for C++0x explicit conversion operators (N2437)
Small cleanup in the handling of user-defined conversions. Also, implement an optimization when constructing a call. We avoid recomputing implicit conversion sequences and instead use those conversion sequences that we computed as part of overload resolution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 0c97611618..f802f5126c 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1873,7 +1873,7 @@ ActOnCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty,
}
if (CheckInitializerTypes(literalExpr, literalType, LParenLoc,
- DeclarationName()))
+ DeclarationName(), /*FIXME:DirectInit=*/false))
return true;
bool isFileScope = getCurFunctionOrMethodDecl() == 0;
@@ -3546,10 +3546,10 @@ Action::ExprResult Sema::ActOnBinOp(Scope *S, SourceLocation TokLoc,
// We matched a built-in operator. Convert the arguments, then
// break out so that we will build the appropriate built-in
// operator node.
- if (PerformCopyInitialization(lhs, Best->BuiltinTypes.ParamTypes[0],
- "passing") ||
- PerformCopyInitialization(rhs, Best->BuiltinTypes.ParamTypes[1],
- "passing"))
+ if (PerformImplicitConversion(lhs, Best->BuiltinTypes.ParamTypes[0],
+ Best->Conversions[0], "passing") ||
+ PerformImplicitConversion(rhs, Best->BuiltinTypes.ParamTypes[1],
+ Best->Conversions[1], "passing"))
return true;
break;
@@ -3644,8 +3644,8 @@ Action::ExprResult Sema::ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
// We matched a built-in operator. Convert the arguments, then
// break out so that we will build the appropriate built-in
// operator node.
- if (PerformCopyInitialization(Input, Best->BuiltinTypes.ParamTypes[0],
- "passing"))
+ if (PerformImplicitConversion(Input, Best->BuiltinTypes.ParamTypes[0],
+ Best->Conversions[0], "passing"))
return true;
break;