From ac576bd974ac27bc1f395e8ae6c77b19f800b6db Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 3 May 2015 21:10:48 +0200 Subject: [PATCH] Bug 746734 - Don't warn about missing documentation for deleted functions. --- src/arguments.cpp | 3 +++ src/arguments.h | 6 ++++-- src/memberdef.cpp | 9 +++++++-- src/memberdef.h | 1 + src/scanner.l | 1 + 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/arguments.cpp b/src/arguments.cpp index 87d043845b3..095aa965a03 100644 --- a/src/arguments.cpp +++ b/src/arguments.cpp @@ -32,6 +32,7 @@ ArgumentList *ArgumentList::deepCopy() const argList->volatileSpecifier = volatileSpecifier; argList->pureSpecifier = pureSpecifier; argList->trailingReturnType = trailingReturnType; + argList->isDeleted = isDeleted; return argList; } @@ -61,6 +62,7 @@ ArgumentList *ArgumentList::unmarshal(StorageIntf *s) result->volatileSpecifier = unmarshalBool(s); result->pureSpecifier = unmarshalBool(s); result->trailingReturnType = unmarshalQCString(s); + result->isDeleted = unmarshalBool(s); return result; } @@ -93,6 +95,7 @@ void ArgumentList::marshal(StorageIntf *s,ArgumentList *argList) marshalBool(s,argList->volatileSpecifier); marshalBool(s,argList->pureSpecifier); marshalQCString(s,argList->trailingReturnType); + marshalBool(s,argList->isDeleted); } } diff --git a/src/arguments.h b/src/arguments.h index 8b3d211cf6f..555b573eb59 100644 --- a/src/arguments.h +++ b/src/arguments.h @@ -86,7 +86,8 @@ class ArgumentList : public QList ArgumentList() : QList(), constSpecifier(FALSE), volatileSpecifier(FALSE), - pureSpecifier(FALSE) + pureSpecifier(FALSE), + isDeleted(FALSE) { setAutoDelete(TRUE); } /*! Destroys the argument list */ ~ArgumentList() {} @@ -102,7 +103,8 @@ class ArgumentList : public QList bool pureSpecifier; /*! C++11 style Trailing return type? */ QCString trailingReturnType; - /*! C++11 defaulted method */ + /*! method with =delete */ + bool isDeleted; static ArgumentList *unmarshal(StorageIntf *s); static void marshal(StorageIntf *s,ArgumentList *argList); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 23c171ae316..7f93b5172e0 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -3231,7 +3231,7 @@ void MemberDef::warnIfUndocumented() !isFriendClass() && name().find('@')==-1 && d && d->name().find('@')==-1 && protectionLevelVisible(m_impl->prot) && - !isReference() + !isReference() && !isDeleted() ) { warn_undoc(d->getDefFileName(),d->getDefLine(),"Member %s%s (%s) of %s %s is not documented.", @@ -3258,11 +3258,16 @@ bool MemberDef::isDocumentedFriendClass() const (fcd=getClass(baseName)) && fcd->isLinkable()); } +bool MemberDef::isDeleted() const +{ + return m_impl->defArgList && m_impl->defArgList->isDeleted; +} + bool MemberDef::hasDocumentation() const { return Definition::hasDocumentation() || (m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) || // has enum values - (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()); // has doc arguments + (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()); // has doc arguments } #if 0 diff --git a/src/memberdef.h b/src/memberdef.h index 93cd72d3bbc..f60fb5469f5 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -188,6 +188,7 @@ class MemberDef : public Definition bool isLinkable() const; bool hasDocumentation() const; // overrides hasDocumentation in definition.h //bool hasUserDocumentation() const; // overrides hasUserDocumentation + bool isDeleted() const; bool isBriefSectionVisible() const; bool isDetailedSectionVisible(bool inGroup,bool inFile) const; bool isDetailedSectionLinkable() const; diff --git a/src/scanner.l b/src/scanner.l index b3ae01ad9fb..4f8cdd8a5c0 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4663,6 +4663,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) lineCount(); current->args += " = delete"; current->spec |= Entry::Delete; + current->argList->isDeleted=TRUE; BEGIN(FuncQual); } {BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator