Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.

llvm-svn: 124039
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a266b60..7c6d9d91 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -6423,6 +6423,7 @@
 }
 
 void Sema::ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagD,
+                                           ClassVirtSpecifiers &CVS,
                                            SourceLocation LBraceLoc) {
   AdjustDeclIfTemplate(TagD);
   CXXRecordDecl *Record = cast<CXXRecordDecl>(TagD);
@@ -6432,6 +6433,9 @@
   if (!Record->getIdentifier())
     return;
 
+  Record->setIsMarkedFinal(CVS.isFinalSpecified());
+  Record->setIsMarkedExplicit(CVS.isExplicitSpecified());
+    
   // C++ [class]p2:
   //   [...] The class-name is also inserted into the scope of the
   //   class itself; this is known as the injected-class-name. For