Skip to content

Commit

Permalink
Bug 746734 - Don't warn about missing documentation for deleted funct…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
Dimitri van Heesch authored and groleo committed May 15, 2015
1 parent 528bb80 commit ac576bd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ArgumentList *ArgumentList::deepCopy() const
argList->volatileSpecifier = volatileSpecifier;
argList->pureSpecifier = pureSpecifier;
argList->trailingReturnType = trailingReturnType;
argList->isDeleted = isDeleted;

return argList;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}

6 changes: 4 additions & 2 deletions src/arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class ArgumentList : public QList<Argument>
ArgumentList() : QList<Argument>(),
constSpecifier(FALSE),
volatileSpecifier(FALSE),
pureSpecifier(FALSE)
pureSpecifier(FALSE),
isDeleted(FALSE)
{ setAutoDelete(TRUE); }
/*! Destroys the argument list */
~ArgumentList() {}
Expand All @@ -102,7 +103,8 @@ class ArgumentList : public QList<Argument>
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);
Expand Down
9 changes: 7 additions & 2 deletions src/memberdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/memberdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
Expand Down

0 comments on commit ac576bd

Please sign in to comment.