================
@@ -2774,6 +2775,66 @@ static void DiagnoseNonAggregateReason(Sema &SemaRef, 
SourceLocation Loc,
     DiagnoseNonAggregateReason(SemaRef, Loc, D);
 }
 
+static void DiagnoseNonAbstractReason(Sema &SemaRef, SourceLocation Loc,
+                                      const CXXRecordDecl *D) {
+  // If this type has any abstract base classes, their respective virtual
+  // functions must have been overridden.
+  for (const CXXBaseSpecifier &B : D->bases()) {
+    assert(B.getType()->getAsCXXRecordDecl() && "invalid base?");
+    if (B.getType()->getAsCXXRecordDecl()->isAbstract()) {
----------------
erichkeane wrote:

```suggestion
    if (B.getType()->castAsCXXRecordDecl()->isAbstract()) {
```

Plus remove the assert, since castAs does it for you.

https://github.com/llvm/llvm-project/pull/156199
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to