summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 344196cc6ff..5720d931b66 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3057,61 +3057,3 @@ ExprResult Sema::ActOnFinishFullExpr(Expr *FullExpr) {
if (!FullExpr) return ExprError();
return MaybeCreateCXXExprWithTemporaries(FullExpr);
}
-
-ExprResult Sema::BuildUDStringLiteralExpr(Scope *S, StringLiteral *SL,
- unsigned L, IdentifierInfo *II) {
- DeclarationName DN = Context.DeclarationNames.getCXXLiteralOperatorName(II);
-
- LookupResult R(*this, DN, SL->getLocStart(), LookupOrdinaryName);
- LookupName(R, S);
-
- llvm::APInt APL(Context.getTypeSize(Context.getSizeType()), L);
-
- Expr *Args[2];
- Args[0] = SL;
- Args[1] = new (Context) IntegerLiteral(Context, APL, Context.getSizeType(),
- SourceLocation());
-
- OverloadCandidateSet CandidateSet(SL->getLocStart());
- AddFunctionCandidates(R.asUnresolvedSet(), Args, 2, CandidateSet);
- OverloadCandidateSet::iterator Best;
- switch (CandidateSet.BestViableFunction(*this, SL->getLocStart(), Best)) {
- case OR_Ambiguous:
- llvm_unreachable("UD literals should not have ambiguous overloads");
- return ExprError();
- case OR_No_Viable_Function:
- Diag(SL->getLocStart(), diag::err_literal_operator_overload)
- << SL->getSourceRange() << II->getName();
- return ExprError();
- case OR_Deleted:
- Diag(SL->getLocStart(), diag::err_literal_operator_deleted)
- << SL->getSourceRange() << II->getName();
- //FIXME: Note the deleted function
- return ExprError();
- case OR_Success:
- break;
- }
-
- assert(Best->Function && "Literal operator function not a real function");
- FunctionDecl *FD = Best->Function;
-
- ExprResult InputInit
- = PerformCopyInitialization(InitializedEntity::InitializeParameter(
- FD->getParamDecl(0)),
- SourceLocation(), Owned(SL));
- if (InputInit.isInvalid())
- return ExprError();
- Args[0] = InputInit.takeAs<Expr>();
-
- QualType ResultTy = FD->getResultType().getNonReferenceType();
- Expr *Fn = new (Context) DeclRefExpr(FD, FD->getType(), SourceLocation());
- UsualUnaryConversions(Fn);
-
- UDLiteralExpr *E = new (Context) UDLiteralExpr(Context, SL, Fn, Args, 2,
- ResultTy);
-
- if (CheckCallReturnType(FD->getResultType(), SL->getLocStart(), E, FD))
- return ExprError();
-
- return MaybeBindToTemporary(E);
-}
OpenPOWER on IntegriCloud