AddInitializerToDecl needs to take a full expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2009-05-30 21:37:25 +00:00
Родитель 0578916f97
Коммит f5dcd38858
6 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -271,7 +271,7 @@ public:
/// This allows ActOnDeclarator to register "xx" prior to parsing the
/// initializer. The declaration above should still result in a warning,
/// since the reference to "xx" is uninitialized.
virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
return;
}

Просмотреть файл

@ -109,7 +109,7 @@ namespace {
/// This allows ActOnDeclarator to register "xx" prior to parsing the
/// initializer. The declaration above should still result in a warning,
/// since the reference to "xx" is uninitialized.
virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
Out << __FUNCTION__ << "\n";
}

Просмотреть файл

@ -360,7 +360,7 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D) {
SkipUntil(tok::semi, true, true);
return DeclPtrTy();
}
Actions.AddInitializerToDecl(ThisDecl, move(Init));
Actions.AddInitializerToDecl(ThisDecl, Actions.FullExpr(Init));
}
} else if (Tok.is(tok::l_paren)) {
// Parse C++ direct initializer: '(' expression-list ')'

Просмотреть файл

@ -409,7 +409,7 @@ public:
virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
SourceLocation EqualLoc);
virtual void ActOnParamDefaultArgumentError(DeclPtrTy param);
virtual void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init);
virtual void AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init);
void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit);
void ActOnUninitializedDecl(DeclPtrTy dcl);
virtual void SetDeclDeleted(DeclPtrTy dcl, SourceLocation DelLoc);

Просмотреть файл

@ -2468,8 +2468,8 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
return true;
}
void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init) {
AddInitializerToDecl(dcl, move(init), /*DirectInit=*/false);
void Sema::AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init) {
AddInitializerToDecl(dcl, init.release(), /*DirectInit=*/false);
}
/// AddInitializerToDecl - Adds the initializer Init to the

Просмотреть файл

@ -744,7 +744,7 @@ Sema::ActOnCXXConditionDeclarationExpr(Scope *S, SourceLocation StartLoc,
DeclPtrTy Dcl = ActOnDeclarator(S, D, DeclPtrTy());
if (!Dcl)
return ExprError();
AddInitializerToDecl(Dcl, move(AssignExprVal));
AddInitializerToDecl(Dcl, move(AssignExprVal), /*DirectInit=*/false);
// Mark this variable as one that is declared within a conditional.
// We know that the decl had to be a VarDecl because that is the only type of