summaryrefslogtreecommitdiffstats
path: root/clang/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
commitfc1eef48980e7d34d1e46c644b96c04f56ea439f (patch)
treecb37a0065d8e744cba2216decef79473f15697f7 /clang/lib/Sema/SemaDecl.cpp
parent7ecb3a040bfdae9d51388b90417b8f9a0ee19558 (diff)
downloadbcm5719-llvm-fc1eef48980e7d34d1e46c644b96c04f56ea439f.tar.gz
bcm5719-llvm-fc1eef48980e7d34d1e46c644b96c04f56ea439f.zip
Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.
llvm-svn: 124039
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a266b60ac38..7c6d9d9142f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud