Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, NamedDecl* PrevDecl,
bool IsFunctionDefinition,
- bool& InvalidDecl, bool &Redeclaration) {
+ bool &InvalidDecl, bool &Redeclaration) {
assert(R.getTypePtr()->isFunctionType());
DeclarationName Name = GetNameForDeclarator(D);
D.getIdentifierLoc(), Name, R,
isExplicit, isInline,
/*isImplicitlyDeclared=*/false);
-
- if (InvalidDecl)
- NewFD->setInvalidDecl();
} else if (D.getKind() == Declarator::DK_Destructor) {
// This is a C++ destructor declaration.
if (DC->isRecord()) {
isInline,
/*isImplicitlyDeclared=*/false);
- if (InvalidDecl)
- NewFD->setInvalidDecl();
-
isVirtualOkay = true;
} else {
Diag(D.getIdentifierLoc(), diag::err_destructor_not_member);
// FIXME: Move to DeclGroup...
D.getDeclSpec().getSourceRange().getBegin());
InvalidDecl = true;
- NewFD->setInvalidDecl();
}
} else if (D.getKind() == Declarator::DK_Conversion) {
if (!DC->isRecord()) {
D.getIdentifierLoc(), Name, R,
isInline, isExplicit);
- if (InvalidDecl)
- NewFD->setInvalidDecl();
-
isVirtualOkay = true;
}
} else if (DC->isRecord()) {
D.getDeclSpec().getSourceRange().getBegin());
}
+ if (InvalidDecl)
+ NewFD->setInvalidDecl();
+
// Set the lexical context. If the declarator has a C++
// scope specifier, the lexical context will be different
// from the semantic context.
// In C++, the empty parameter-type-list must be spelled "void"; a
// typedef of void is not permitted.
if (getLangOptions().CPlusPlus &&
- Param->getType().getUnqualifiedType() != Context.VoidTy) {
+ Param->getType().getUnqualifiedType() != Context.VoidTy)
Diag(Param->getLocation(), diag::err_param_typedef_of_void);
- }
} else if (FTI.NumArgs > 0 && FTI.ArgInfo[0].Param != 0) {
for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i)
Params.push_back(FTI.ArgInfo[i].Param.getAs<ParmVarDecl>());
ArgType != FT->arg_type_end(); ++ArgType) {
ParmVarDecl *Param = ParmVarDecl::Create(Context, DC,
SourceLocation(), 0,
- *ArgType, VarDecl::None,
- 0);
+ *ArgType, VarDecl::None, 0);
Param->setImplicit();
Params.push_back(Param);
}