|
@@ -1609,9 +1609,8 @@ static ExprResult BuildCookedLiteralOperatorCall(Sema &S, Scope *Scope,
|
|
|
|
|
|
LookupResult R(S, OpName, UDSuffixLoc, Sema::LookupOrdinaryName);
|
|
LookupResult R(S, OpName, UDSuffixLoc, Sema::LookupOrdinaryName);
|
|
if (S.LookupLiteralOperator(Scope, R, llvm::makeArrayRef(ArgTy, Args.size()),
|
|
if (S.LookupLiteralOperator(Scope, R, llvm::makeArrayRef(ArgTy, Args.size()),
|
|
- /*AllowRaw*/ false, /*AllowTemplate*/ false,
|
|
|
|
- /*AllowStringTemplate*/ false,
|
|
|
|
- /*DiagnoseMissing*/ true) == Sema::LOLR_Error)
|
|
|
|
|
|
+ /*AllowRaw*/false, /*AllowTemplate*/false,
|
|
|
|
+ /*AllowStringTemplate*/false) == Sema::LOLR_Error)
|
|
return ExprError();
|
|
return ExprError();
|
|
|
|
|
|
return S.BuildLiteralOperatorCall(R, OpNameInfo, Args, LitEndLoc);
|
|
return S.BuildLiteralOperatorCall(R, OpNameInfo, Args, LitEndLoc);
|
|
@@ -1702,9 +1701,8 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {
|
|
|
|
|
|
LookupResult R(*this, OpName, UDSuffixLoc, LookupOrdinaryName);
|
|
LookupResult R(*this, OpName, UDSuffixLoc, LookupOrdinaryName);
|
|
switch (LookupLiteralOperator(UDLScope, R, ArgTy,
|
|
switch (LookupLiteralOperator(UDLScope, R, ArgTy,
|
|
- /*AllowRaw*/ false, /*AllowTemplate*/ false,
|
|
|
|
- /*AllowStringTemplate*/ true,
|
|
|
|
- /*DiagnoseMissing*/ true)) {
|
|
|
|
|
|
+ /*AllowRaw*/false, /*AllowTemplate*/false,
|
|
|
|
+ /*AllowStringTemplate*/true)) {
|
|
|
|
|
|
case LOLR_Cooked: {
|
|
case LOLR_Cooked: {
|
|
llvm::APInt Len(Context.getIntWidth(SizeType), Literal.GetNumStringChars());
|
|
llvm::APInt Len(Context.getIntWidth(SizeType), Literal.GetNumStringChars());
|
|
@@ -1737,7 +1735,6 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {
|
|
}
|
|
}
|
|
case LOLR_Raw:
|
|
case LOLR_Raw:
|
|
case LOLR_Template:
|
|
case LOLR_Template:
|
|
- case LOLR_ErrorNoDiagnostic:
|
|
|
|
llvm_unreachable("unexpected literal operator lookup result");
|
|
llvm_unreachable("unexpected literal operator lookup result");
|
|
case LOLR_Error:
|
|
case LOLR_Error:
|
|
return ExprError();
|
|
return ExprError();
|
|
@@ -3360,15 +3357,11 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
|
|
// literal or a cooked one.
|
|
// literal or a cooked one.
|
|
LookupResult R(*this, OpName, UDSuffixLoc, LookupOrdinaryName);
|
|
LookupResult R(*this, OpName, UDSuffixLoc, LookupOrdinaryName);
|
|
switch (LookupLiteralOperator(UDLScope, R, CookedTy,
|
|
switch (LookupLiteralOperator(UDLScope, R, CookedTy,
|
|
- /*AllowRaw*/ true, /*AllowTemplate*/ true,
|
|
|
|
- /*AllowStringTemplate*/ false,
|
|
|
|
- /*DiagnoseMissing*/ !Literal.isImaginary)) {
|
|
|
|
- case LOLR_ErrorNoDiagnostic:
|
|
|
|
- // Lookup failure for imaginary constants isn't fatal, there's still the
|
|
|
|
- // GNU extension producing _Complex types.
|
|
|
|
- break;
|
|
|
|
|
|
+ /*AllowRaw*/true, /*AllowTemplate*/true,
|
|
|
|
+ /*AllowStringTemplate*/false)) {
|
|
case LOLR_Error:
|
|
case LOLR_Error:
|
|
return ExprError();
|
|
return ExprError();
|
|
|
|
+
|
|
case LOLR_Cooked: {
|
|
case LOLR_Cooked: {
|
|
Expr *Lit;
|
|
Expr *Lit;
|
|
if (Literal.isFloatingLiteral()) {
|
|
if (Literal.isFloatingLiteral()) {
|
|
@@ -3584,12 +3577,10 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
|
|
}
|
|
}
|
|
|
|
|
|
// If this is an imaginary literal, create the ImaginaryLiteral wrapper.
|
|
// If this is an imaginary literal, create the ImaginaryLiteral wrapper.
|
|
- if (Literal.isImaginary) {
|
|
|
|
|
|
+ if (Literal.isImaginary)
|
|
Res = new (Context) ImaginaryLiteral(Res,
|
|
Res = new (Context) ImaginaryLiteral(Res,
|
|
Context.getComplexType(Res->getType()));
|
|
Context.getComplexType(Res->getType()));
|
|
|
|
|
|
- Diag(Tok.getLocation(), diag::ext_imaginary_constant);
|
|
|
|
- }
|
|
|
|
return Res;
|
|
return Res;
|
|
}
|
|
}
|
|
|
|
|