diff options
author | John McCall <rjmccall@apple.com> | 2010-08-23 23:25:46 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-23 23:25:46 +0000 |
commit | 9ae2f076ca5ab1feb3ba95629099ec2319833701 (patch) | |
tree | 1ca906b560daa2bee38b38a5043ddd50e31420bf /lib/Sema/SemaTemplate.cpp | |
parent | 58ddb60f409125eda5436c4a1f070f7fa4744295 (diff) |
Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 33ef32a8e7..9445ced11c 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -584,7 +584,7 @@ Decl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, unsigned Depth, unsigned Position, SourceLocation EqualLoc, - ExprArg DefaultArg) { + Expr *Default) { TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S); QualType T = TInfo->getType(); @@ -622,14 +622,14 @@ Decl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, } // Check the well-formedness of the default template argument, if provided. - if (Expr *Default = static_cast<Expr *>(DefaultArg.get())) { + if (Default) { TemplateArgument Converted; if (CheckTemplateArgument(Param, Param->getType(), Default, Converted)) { Param->setInvalidDecl(); return Param; } - Param->setDefaultArgument(DefaultArg.takeAs<Expr>(), false); + Param->setDefaultArgument(Default, false); } return Param; @@ -3057,7 +3057,8 @@ Sema::BuildExpressionFromDeclTemplateArgument(const TemplateArgument &Arg, QualType ClassType = Context.getTypeDeclType(cast<RecordDecl>(VD->getDeclContext())); NestedNameSpecifier *Qualifier - = NestedNameSpecifier::Create(Context, 0, false, ClassType.getTypePtr()); + = NestedNameSpecifier::Create(Context, 0, false, + ClassType.getTypePtr()); CXXScopeSpec SS; SS.setScopeRep(Qualifier); OwningExprResult RefExpr = BuildDeclRefExpr(VD, @@ -3067,7 +3068,7 @@ Sema::BuildExpressionFromDeclTemplateArgument(const TemplateArgument &Arg, if (RefExpr.isInvalid()) return ExprError(); - RefExpr = CreateBuiltinUnaryOp(Loc, UnaryOperator::AddrOf, move(RefExpr)); + RefExpr = CreateBuiltinUnaryOp(Loc, UnaryOperator::AddrOf, RefExpr.get()); // We might need to perform a trailing qualification conversion, since // the element type on the parameter could be more qualified than the @@ -3108,7 +3109,7 @@ Sema::BuildExpressionFromDeclTemplateArgument(const TemplateArgument &Arg, } // Take the address of everything else - return CreateBuiltinUnaryOp(Loc, UnaryOperator::AddrOf, move(RefExpr)); + return CreateBuiltinUnaryOp(Loc, UnaryOperator::AddrOf, RefExpr.get()); } // If the non-type template parameter has reference type, qualify the |