aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 4cd4300bcd..e93624af15 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1149,15 +1149,26 @@ namespace {
}
}
+
bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
unsigned DiagID, AbstractDiagSelID SelID,
const CXXRecordDecl *CurrentRD) {
+ if (SelID == -1)
+ return RequireNonAbstractType(Loc, T,
+ PDiag(DiagID), CurrentRD);
+ else
+ return RequireNonAbstractType(Loc, T,
+ PDiag(DiagID) << SelID, CurrentRD);
+}
+bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
+ const PartialDiagnostic &PD,
+ const CXXRecordDecl *CurrentRD) {
if (!getLangOptions().CPlusPlus)
return false;
if (const ArrayType *AT = Context.getAsArrayType(T))
- return RequireNonAbstractType(Loc, AT->getElementType(), DiagID, SelID,
+ return RequireNonAbstractType(Loc, AT->getElementType(), PD,
CurrentRD);
if (const PointerType *PT = T->getAs<PointerType>()) {
@@ -1166,8 +1177,7 @@ bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
PT = T;
if (const ArrayType *AT = Context.getAsArrayType(PT->getPointeeType()))
- return RequireNonAbstractType(Loc, AT->getElementType(), DiagID, SelID,
- CurrentRD);
+ return RequireNonAbstractType(Loc, AT->getElementType(), PD, CurrentRD);
}
const RecordType *RT = T->getAs<RecordType>();
@@ -1184,7 +1194,7 @@ bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
if (!RD->isAbstract())
return false;
- Diag(Loc, DiagID) << RD->getDeclName() << SelID;
+ Diag(Loc, PD) << RD->getDeclName();
// Check if we've already emitted the list of pure virtual functions for this
// class.