Make CheckOverrideControl a member of Sema.

llvm-svn: 123893
This commit is contained in:
Anders Carlsson 2011-01-20 06:29:02 +00:00
parent 2cd1f0beb6
commit c87f861d0a
2 changed files with 6 additions and 4 deletions

View File

@ -2724,6 +2724,9 @@ public:
bool CheckPureMethod(CXXMethodDecl *Method, SourceRange InitRange);
/// CheckOverrideControl - Check C++0x override control semantics.
void CheckOverrideControl(const Decl *D);
//===--------------------------------------------------------------------===//
// C++ Access Control
//

View File

@ -853,8 +853,7 @@ Decl *Sema::ActOnAccessSpecifier(AccessSpecifier Access,
}
/// CheckOverrideControl - Check C++0x override control semantics.
static void
CheckOverrideControl(Sema& SemaRef, const Decl *D) {
void Sema::CheckOverrideControl(const Decl *D) {
const CXXMethodDecl *MD = llvm::dyn_cast<CXXMethodDecl>(D);
if (!MD || !MD->isVirtual())
return;
@ -866,7 +865,7 @@ CheckOverrideControl(Sema& SemaRef, const Decl *D) {
bool HasOverriddenMethods =
MD->begin_overridden_methods() != MD->end_overridden_methods();
if (MD->isMarkedOverride() && !HasOverriddenMethods) {
SemaRef.Diag(MD->getLocation(),
Diag(MD->getLocation(),
diag::err_function_marked_override_not_overriding)
<< MD->getDeclName();
return;
@ -1029,7 +1028,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
MD->setIsMarkedFinal(true);
}
CheckOverrideControl(*this, Member);
CheckOverrideControl(Member);
assert((Name || isInstField) && "No identifier for non-field ?");