diff options
author | Anders Carlsson <andersca@mac.com> | 2011-01-22 17:51:53 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-01-22 17:51:53 +0000 |
commit | dfc2f1035d23e294b298766a3cf51dfe249d53a2 (patch) | |
tree | 3c4d10067cab04f42fca75f05e648763728ba02d /lib/Sema/SemaDecl.cpp | |
parent | b76cc4d4445fd9e5b29722407ce870e3f5a64cca (diff) |
Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a266b60ac3..7c6d9d9142 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6423,6 +6423,7 @@ void Sema::ActOnTagStartDefinition(Scope *S, Decl *TagD) { } void Sema::ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagD, + ClassVirtSpecifiers &CVS, SourceLocation LBraceLoc) { AdjustDeclIfTemplate(TagD); CXXRecordDecl *Record = cast<CXXRecordDecl>(TagD); @@ -6432,6 +6433,9 @@ void Sema::ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagD, 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 |