]> granicus.if.org Git - clang/commitdiff
Make CheckOverrideControl a member of Sema.
authorAnders Carlsson <andersca@mac.com>
Thu, 20 Jan 2011 06:29:02 +0000 (06:29 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 20 Jan 2011 06:29:02 +0000 (06:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123893 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp

index a7fe528f06697919134f990ce9cd7358d0f3b43c..0db20c97d830df9db63eb3dc5dc64fb5c96a790f 100644 (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
   //
index 8fe4852890d7bd0219697a9bce97a151074e2cb9..9981b1f6c8986983d80b8d2c09a86b1e44d78171 100644 (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 ?");