aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-01-22 17:51:53 +0000
committerAnders Carlsson <andersca@mac.com>2011-01-22 17:51:53 +0000
commitdfc2f1035d23e294b298766a3cf51dfe249d53a2 (patch)
tree3c4d10067cab04f42fca75f05e648763728ba02d /lib/Sema/SemaDecl.cpp
parentb76cc4d4445fd9e5b29722407ce870e3f5a64cca (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.cpp4
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