summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-09-21 03:21:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-09-21 03:21:07 +0000
commitb6b5b97c517cc651285f620a70b1ca52fa808c5a (patch)
tree120ae0f4496a0f7791c07efde3b7a162fc24eb52 /lib
parent1f94124b76680211f3585ac8c3b24b247f46fac3 (diff)
downloadclang-b6b5b97c517cc651285f620a70b1ca52fa808c5a.tar.gz
PR13890: Warn on abstract final classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index e0c655f879..3191e3fb48 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3840,6 +3840,11 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
diag::warn_non_virtual_dtor) << Context.getRecordType(Record);
}
+ if (Record->isAbstract() && Record->hasAttr<FinalAttr>()) {
+ Diag(Record->getLocation(), diag::warn_abstract_final_class);
+ DiagnoseAbstractType(Record);
+ }
+
// See if a method overloads virtual methods in a base
/// class without overriding any.
if (!Record->isDependentType()) {