}
}
+static bool isUsingDecl(Decl *D) {
+ return isa<UsingDecl>(D) || isa<UnresolvedUsingDecl>(D);
+}
+
NamedDecl*
Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, DeclaratorInfo *DInfo,
Diag(NewFD->getLocation(), diag::err_out_of_line_declaration)
<< D.getCXXScopeSpec().getRange();
NewFD->setInvalidDecl();
- } else if (!Redeclaration && (!PrevDecl || !isa<UsingDecl>(PrevDecl))) {
+ } else if (!Redeclaration && (!PrevDecl || !isUsingDecl(PrevDecl))) {
// The user tried to provide an out-of-line definition for a
// function that is a member of a class or namespace, but there
// was no such member function declared (C++ [class.mfct]p2,
}
}
- if (PrevDecl &&
+ if (PrevDecl &&
(!AllowOverloadingOfFunction(PrevDecl, Context) ||
- !IsOverload(NewFD, PrevDecl, MatchedDecl)) &&
- !isa<UsingDecl>(PrevDecl) && !isa<UnresolvedUsingDecl>(PrevDecl)) {
+ !IsOverload(NewFD, PrevDecl, MatchedDecl)) && !isUsingDecl(PrevDecl)) {
Redeclaration = true;
Decl *OldDecl = PrevDecl;