[C++11] Use 'nullptr'. Parser edition.
llvm-svn: 209275
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 26ff273..ff19826 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -207,7 +207,7 @@
}
if (LastII)
- *LastII = 0;
+ *LastII = nullptr;
bool HasScopeSpecifier = false;
@@ -462,7 +462,7 @@
CheckForLParenAfterColonColon();
bool IsCorrectedToColon = false;
- bool *CorrectionFlagPtr = ColonIsSacred ? &IsCorrectedToColon : 0;
+ bool *CorrectionFlagPtr = ColonIsSacred ? &IsCorrectedToColon : nullptr;
if (Actions.ActOnCXXNestedNameSpecifier(getCurScope(), II, IdLoc, CCLoc,
ObjectType, EnteringContext, SS,
false, CorrectionFlagPtr)) {
@@ -793,7 +793,7 @@
// Parse capture.
LambdaCaptureKind Kind = LCK_ByCopy;
SourceLocation Loc;
- IdentifierInfo* Id = 0;
+ IdentifierInfo *Id = nullptr;
SourceLocation EllipsisLoc;
ExprResult Init;
@@ -1092,7 +1092,7 @@
DynamicExceptionRanges.data(),
DynamicExceptions.size(),
NoexceptExpr.isUsable() ?
- NoexceptExpr.get() : 0,
+ NoexceptExpr.get() : nullptr,
LParenLoc, FunLocalRangeEnd, D,
TrailingReturnType),
Attr, DeclEndLoc);
@@ -1144,7 +1144,7 @@
D.AddTypeInfo(DeclaratorChunk::getFunction(/*hasProto=*/true,
/*isAmbiguous=*/false,
/*LParenLoc=*/NoLoc,
- /*Params=*/0,
+ /*Params=*/nullptr,
/*NumParams=*/0,
/*EllipsisLoc=*/NoLoc,
/*RParenLoc=*/NoLoc,
@@ -1156,10 +1156,10 @@
MutableLoc,
EST_None,
/*ESpecLoc=*/NoLoc,
- /*Exceptions=*/0,
- /*ExceptionRanges=*/0,
+ /*Exceptions=*/nullptr,
+ /*ExceptionRanges=*/nullptr,
/*NumExceptions=*/0,
- /*NoexceptExpr=*/0,
+ /*NoexceptExpr=*/nullptr,
DeclLoc, DeclEndLoc, D,
TrailingReturnType),
Attr, DeclEndLoc);
@@ -1201,7 +1201,7 @@
///
ExprResult Parser::ParseCXXCasts() {
tok::TokenKind Kind = Tok.getKind();
- const char *CastName = 0; // For error messages
+ const char *CastName = nullptr; // For error messages
switch (Kind) {
default: llvm_unreachable("Unknown C++ cast!");
@@ -1417,7 +1417,7 @@
assert(Tok.is(tok::coloncolon) &&"ParseOptionalCXXScopeSpecifier fail");
CCLoc = ConsumeToken();
} else {
- FirstTypeName.setIdentifier(0, SourceLocation());
+ FirstTypeName.setIdentifier(nullptr, SourceLocation());
}
// Parse the tilde.
@@ -1489,7 +1489,7 @@
case tok::r_brace:
case tok::colon:
case tok::comma:
- return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, 0);
+ return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, nullptr);
default:
ExprResult Expr(ParseAssignmentExpression());
@@ -1608,7 +1608,7 @@
// Parse the expression.
ExprOut = ParseExpression(); // expression
- DeclOut = 0;
+ DeclOut = nullptr;
if (ExprOut.isInvalid())
return true;
@@ -1996,7 +1996,7 @@
TemplateId->Operator = OO_None;
TemplateId->TemplateNameLoc = Id.StartLocation;
} else {
- TemplateId->Name = 0;
+ TemplateId->Name = nullptr;
TemplateId->Operator = Id.OperatorFunctionId.Operator;
TemplateId->TemplateNameLoc = Id.StartLocation;
}
@@ -2201,7 +2201,7 @@
// Grab the literal operator's suffix, which will be either the next token
// or a ud-suffix from the string literal.
- IdentifierInfo *II = 0;
+ IdentifierInfo *II = nullptr;
SourceLocation SuffixLoc;
if (!Literal.getUDSuffix().empty()) {
II = &PP.getIdentifierTable().get(Literal.getUDSuffix());
@@ -2262,8 +2262,8 @@
// Parse the conversion-declarator, which is merely a sequence of
// ptr-operators.
Declarator D(DS, Declarator::ConversionIdContext);
- ParseDeclaratorInternal(D, /*DirectDeclParser=*/0);
-
+ ParseDeclaratorInternal(D, /*DirectDeclParser=*/nullptr);
+
// Finish up the type.
TypeResult Ty = Actions.ActOnTypeName(getCurScope(), D);
if (Ty.isInvalid())
@@ -2419,10 +2419,10 @@
Result.getKind() == UnqualifiedId::IK_LiteralOperatorId) &&
(TemplateSpecified || Tok.is(tok::less)))
return ParseUnqualifiedIdTemplateId(SS, TemplateKWLoc,
- 0, SourceLocation(),
+ nullptr, SourceLocation(),
EnteringContext, ObjectType,
Result, TemplateSpecified);
-
+
return false;
}
@@ -2861,7 +2861,7 @@
switch (ATT) {
case ATT_ArrayRank: {
T.consumeClose();
- return Actions.ActOnArrayTypeTrait(ATT, Loc, Ty.get(), NULL,
+ return Actions.ActOnArrayTypeTrait(ATT, Loc, Ty.get(), nullptr,
T.getCloseLocation());
}
case ATT_ArrayExtent: {