diff options
author | David Blaikie <dblaikie@gmail.com> | 2016-01-15 23:43:34 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2016-01-15 23:43:34 +0000 |
commit | efdccaa94fc1d0848c3f4a5a75aa533f2c79bc39 (patch) | |
tree | 29b3ddd7a0a157da58ec81201deac017c36a6ce5 /clang/lib/Parse/ParseExprCXX.cpp | |
parent | e20506d1e442de1c64b7c6241809be9d1cfe1e8b (diff) | |
download | bcm5719-llvm-efdccaa94fc1d0848c3f4a5a75aa533f2c79bc39.tar.gz bcm5719-llvm-efdccaa94fc1d0848c3f4a5a75aa533f2c79bc39.zip |
OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef
llvm-svn: 257958
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index f8938ba3495..53009caf8c7 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -283,8 +283,8 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, // // To implement this, we clear out the object type as soon as we've // seen a leading '::' or part of a nested-name-specifier. - ObjectType = ParsedType(); - + ObjectType = nullptr; + if (Tok.is(tok::code_completion)) { // Code completion for a nested-name-specifier, where the code // code completion token follows the '::'. @@ -597,7 +597,7 @@ ExprResult Parser::tryParseCXXIdExpression(CXXScopeSpec &SS, bool isAddressOfOpe /*EnteringContext=*/false, /*AllowDestructorName=*/false, /*AllowConstructorName=*/false, - /*ObjectType=*/ParsedType(), TemplateKWLoc, Name)) + /*ObjectType=*/nullptr, TemplateKWLoc, Name)) return ExprError(); // This is only the direct operand of an & operator if it is not @@ -659,7 +659,7 @@ ExprResult Parser::ParseCXXIdExpression(bool isAddressOfOperand) { // '::' unqualified-id // CXXScopeSpec SS; - ParseOptionalCXXScopeSpecifier(SS, ParsedType(), /*EnteringContext=*/false); + ParseOptionalCXXScopeSpecifier(SS, nullptr, /*EnteringContext=*/false); Token Replacement; ExprResult Result = @@ -2413,9 +2413,8 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, if (AllowConstructorName && Actions.isCurrentClassName(*Id, getCurScope(), &SS)) { // We have parsed a constructor name. - ParsedType Ty = Actions.getTypeName(*Id, IdLoc, getCurScope(), - &SS, false, false, - ParsedType(), + ParsedType Ty = Actions.getTypeName(*Id, IdLoc, getCurScope(), &SS, false, + false, nullptr, /*IsCtorOrDtorName=*/true, /*NonTrivialTypeSourceInfo=*/true); Result.setConstructorName(Ty, IdLoc, IdLoc); @@ -2451,13 +2450,11 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, << TemplateId->Name << FixItHint::CreateRemoval( SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc)); - ParsedType Ty = Actions.getTypeName(*TemplateId->Name, - TemplateId->TemplateNameLoc, - getCurScope(), - &SS, false, false, - ParsedType(), - /*IsCtorOrDtorName=*/true, - /*NontrivialTypeSourceInfo=*/true); + ParsedType Ty = + Actions.getTypeName(*TemplateId->Name, TemplateId->TemplateNameLoc, + getCurScope(), &SS, false, false, nullptr, + /*IsCtorOrDtorName=*/true, + /*NontrivialTypeSourceInfo=*/true); Result.setConstructorName(Ty, TemplateId->TemplateNameLoc, TemplateId->RAngleLoc); ConsumeToken(); @@ -2541,7 +2538,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, if (ParseOptionalCXXScopeSpecifier(SS, ObjectType, EnteringContext)) return true; if (SS.isNotEmpty()) - ObjectType = ParsedType(); + ObjectType = nullptr; if (Tok.isNot(tok::identifier) || NextToken().is(tok::coloncolon) || !SS.isSet()) { Diag(TildeLoc, diag::err_destructor_tilde_scope); @@ -2563,7 +2560,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, SourceLocation ClassNameLoc = ConsumeToken(); if (TemplateSpecified || Tok.is(tok::less)) { - Result.setDestructorName(TildeLoc, ParsedType(), ClassNameLoc); + Result.setDestructorName(TildeLoc, nullptr, ClassNameLoc); return ParseUnqualifiedIdTemplateId(SS, TemplateKWLoc, ClassName, ClassNameLoc, EnteringContext, ObjectType, @@ -3029,7 +3026,7 @@ Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType, assert(isTypeIdInParens() && "Not a type-id!"); ExprResult Result(true); - CastTy = ParsedType(); + CastTy = nullptr; // We need to disambiguate a very ugly part of the C++ syntax: // |