Skip to content

Commit

Permalink
Merge branch 'master' into feature/bug_warn_pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Apr 15, 2024
2 parents 32ba032 + 2335bf0 commit 826d963
Show file tree
Hide file tree
Showing 78 changed files with 661 additions and 715 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ if (ENABLE_CLANG_TIDY)
if (CLANGTIDY)
set(CMAKE_CXX_CLANG_TIDY clang-tidy;
-header-filter=.;
-checks=-*,cppcoreguidelines-special-member-functions)
-checks=-*,cppcoreguidelines-special-member-functions
#-checks=-*,modernize-use-nullptr
#-checks=-*,modernize-use-override
#-checks=-*,modernize-use-emplace
)
else()
message(SEND_ERROR "clang-tidy requested but executable not found")
endif()
Expand Down
6 changes: 3 additions & 3 deletions libxml/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class XMLParser : public XMLLocator
*/
XMLParser(const XMLHandlers &handlers);
/*! Destructor */
~XMLParser();
~XMLParser() override;
XMLParser(const XMLParser &) = delete;
XMLParser &operator=(const XMLParser &) = delete;
XMLParser(XMLParser &&) = delete;
Expand All @@ -103,8 +103,8 @@ class XMLParser : public XMLLocator
);

private:
virtual int lineNr() const override;
virtual std::string fileName() const override;
int lineNr() const override;
std::string fileName() const override;
struct Private;
std::unique_ptr<Private> p;
};
Expand Down
4 changes: 2 additions & 2 deletions src/cite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class CiteInfoImpl : public CiteInfo
CiteInfoImpl(const QCString &label, const QCString &text=QCString())
: m_label(label), m_text(text) { }

virtual QCString label() const { return m_label; }
virtual QCString text() const { return m_text; }
QCString label() const override { return m_label; }
QCString text() const override { return m_text; }

void setText(const QCString &s) { m_text = s; }

Expand Down
70 changes: 35 additions & 35 deletions src/classdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ void ClassDefImpl::insertBaseClass(ClassDef *cd,const QCString &n,Protection p,
Specifier s,const QCString &t)
{
//printf("*** insert base class %s into %s\n",qPrint(cd->name()),qPrint(name()));
m_impl->inherits.push_back(BaseClassDef(cd,n,p,s,t));
m_impl->inherits.emplace_back(cd,n,p,s,t);
m_impl->isSimple = FALSE;
}

Expand All @@ -893,7 +893,7 @@ void ClassDefImpl::insertSubClass(ClassDef *cd,Protection p,
//printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
if (!extractPrivate && cd->protection()==Protection::Private) return;
m_impl->inheritedBy.push_back(BaseClassDef(cd,QCString(),p,s,t));
m_impl->inheritedBy.emplace_back(cd,QCString(),p,s,t);
m_impl->isSimple = FALSE;
}

Expand Down Expand Up @@ -1282,9 +1282,9 @@ static void writeInheritanceSpecifier(OutputList &ol,const BaseClassDef &bcd)
ol.startTypewriter();
ol.docify(" [");
StringVector sl;
if (bcd.prot==Protection::Protected) sl.push_back("protected");
else if (bcd.prot==Protection::Private) sl.push_back("private");
if (bcd.virt==Specifier::Virtual) sl.push_back("virtual");
if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
else if (bcd.prot==Protection::Private) sl.emplace_back("private");
if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
bool first=true;
for (const auto &s : sl)
{
Expand Down Expand Up @@ -2535,11 +2535,11 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCStrin
void ClassDefImpl::addClassAttributes(OutputList &ol) const
{
StringVector sl;
if (isFinal()) sl.push_back("final");
if (isSealed()) sl.push_back("sealed");
if (isAbstract()) sl.push_back("abstract");
if (isExported()) sl.push_back("export");
if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.push_back("published");
if (isFinal()) sl.emplace_back("final");
if (isSealed()) sl.emplace_back("sealed");
if (isAbstract()) sl.emplace_back("abstract");
if (isExported()) sl.emplace_back("export");
if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");

for (const auto &sx : m_impl->qualifiers)
{
Expand Down Expand Up @@ -3130,35 +3130,35 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
{
sl.push_back(theTranslator->trVhdlType(md->getVhdlSpecifiers(),TRUE).str()); //append vhdl type
}
else if (md->isFriend()) sl.push_back("friend");
else if (md->isRelated()) sl.push_back("related");
else if (md->isFriend()) sl.emplace_back("friend");
else if (md->isRelated()) sl.emplace_back("related");
else
{
if (Config_getBool(INLINE_INFO) && md->isInline())
sl.push_back("inline");
if (md->isExplicit()) sl.push_back("explicit");
if (md->isMutable()) sl.push_back("mutable");
if (prot==Protection::Protected) sl.push_back("protected");
else if (prot==Protection::Private) sl.push_back("private");
else if (prot==Protection::Package) sl.push_back("package");
sl.emplace_back("inline");
if (md->isExplicit()) sl.emplace_back("explicit");
if (md->isMutable()) sl.emplace_back("mutable");
if (prot==Protection::Protected) sl.emplace_back("protected");
else if (prot==Protection::Private) sl.emplace_back("private");
else if (prot==Protection::Package) sl.emplace_back("package");
if (virt==Specifier::Virtual && getLanguage()!=SrcLangExt::ObjC)
sl.push_back("virtual");
else if (virt==Specifier::Pure) sl.push_back("pure virtual");
if (md->isStatic()) sl.push_back("static");
if (md->isSignal()) sl.push_back("signal");
if (md->isSlot()) sl.push_back("slot");
sl.emplace_back("virtual");
else if (virt==Specifier::Pure) sl.emplace_back("pure virtual");
if (md->isStatic()) sl.emplace_back("static");
if (md->isSignal()) sl.emplace_back("signal");
if (md->isSlot()) sl.emplace_back("slot");
// this is the extra member page
if (md->isOptional()) sl.push_back("optional");
if (md->isAttribute()) sl.push_back("attribute");
if (md->isUNOProperty()) sl.push_back("property");
if (md->isReadonly()) sl.push_back("readonly");
if (md->isBound()) sl.push_back("bound");
if (md->isRemovable()) sl.push_back("removable");
if (md->isConstrained()) sl.push_back("constrained");
if (md->isTransient()) sl.push_back("transient");
if (md->isMaybeVoid()) sl.push_back("maybevoid");
if (md->isMaybeDefault()) sl.push_back("maybedefault");
if (md->isMaybeAmbiguous()) sl.push_back("maybeambiguous");
if (md->isOptional()) sl.emplace_back("optional");
if (md->isAttribute()) sl.emplace_back("attribute");
if (md->isUNOProperty()) sl.emplace_back("property");
if (md->isReadonly()) sl.emplace_back("readonly");
if (md->isBound()) sl.emplace_back("bound");
if (md->isRemovable()) sl.emplace_back("removable");
if (md->isConstrained()) sl.emplace_back("constrained");
if (md->isTransient()) sl.emplace_back("transient");
if (md->isMaybeVoid()) sl.emplace_back("maybevoid");
if (md->isMaybeDefault()) sl.emplace_back("maybedefault");
if (md->isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
}
bool firstSpan=true;
for (const auto &s : sl)
Expand Down Expand Up @@ -4093,7 +4093,7 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
templateClass->setOuterScope(getOuterScope());
templateClass->setHidden(isHidden());
templateClass->setArtificial(isArtificial());
m_impl->templateInstances.push_back(TemplateInstanceDef(templSpec,templateClass));
m_impl->templateInstances.emplace_back(templSpec,templateClass);

// also add nested classes
for (const auto &innerCd : m_impl->innerClasses)
Expand Down
37 changes: 0 additions & 37 deletions src/classdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,14 @@ class ClassDef : public Definition
// --- getters
//-----------------------------------------------------------------------------------

/** Used for RTTI, this is a class */
virtual DefType definitionType() const = 0;

/** Returns the unique base name (without extension) of the class's file on disk */
virtual QCString getOutputFileBase() const = 0;
virtual QCString getInstanceOutputFileBase() const = 0;

/** Returns the base name for the source code file */
virtual QCString getSourceFileBase() const = 0;

/** If this class originated from a tagfile, this will return the tag file reference */
virtual QCString getReference() const = 0;

/** Returns TRUE if this class is imported via a tag file */
virtual bool isReference() const = 0;

/** Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES */
virtual bool isLocal() const = 0;

/** returns the classes nested into this class */
virtual ClassLinkedRefMap getClasses() const = 0;

/** returns TRUE if this class has documentation */
virtual bool hasDocumentation() const = 0;

/** returns TRUE if this class has a non-empty detailed description */
virtual bool hasDetailedDescription() const = 0;

Expand All @@ -155,9 +138,6 @@ class ClassDef : public Definition
/** returns the file name to use for the inheritance graph */
virtual QCString inheritanceGraphFileName() const = 0;

/** Returns the name as it is appears in the documentation */
virtual QCString displayName(bool includeScope=TRUE) const = 0;

/** Returns the type of compound this is, i.e. class/struct/union/.. */
virtual CompoundType compoundType() const = 0;

Expand Down Expand Up @@ -189,15 +169,6 @@ class ClassDef : public Definition
*/
virtual Protection protection() const = 0;

/** returns TRUE iff a link is possible to this item within this project.
*/
virtual bool isLinkableInProject() const = 0;

/** return TRUE iff a link to this class is possible (either within
* this project, or as a cross-reference to another project).
*/
virtual bool isLinkable() const = 0;

/** the class is visible in a class diagram, or class hierarchy */
virtual bool isVisibleInHierarchy() const = 0;

Expand Down Expand Up @@ -264,12 +235,6 @@ class ClassDef : public Definition

virtual bool isTemplateArgument() const = 0;

/** Returns the definition of a nested compound if
* available, or 0 otherwise.
* @param name The name of the nested compound
*/
virtual const Definition *findInnerCompound(const QCString &name) const = 0;

/** Returns the template parameter lists that form the template
* declaration of this class.
*
Expand Down Expand Up @@ -335,7 +300,6 @@ class ClassDef : public Definition

virtual bool isUsedOnly() const = 0;

virtual QCString anchor() const = 0;
virtual bool isEmbeddedInOuterScope() const = 0;

virtual bool isSimple() const = 0;
Expand Down Expand Up @@ -453,7 +417,6 @@ class ClassDefMutable : public DefinitionMutable, public ClassDef
virtual void insertMember(MemberDef *) = 0;
virtual void insertUsedFile(const FileDef *) = 0;
virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec) = 0;
virtual void addInnerCompound(Definition *d) = 0;
virtual bool addExample(const QCString &anchor,const QCString &name, const QCString &file) = 0;
virtual void addUsedClass(ClassDef *cd,const QCString &accessName,Protection prot) = 0;
virtual void addUsedByClass(ClassDef *cd,const QCString &accessName,Protection prot) = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CCodeParser : public CodeParserInterface
{
public:
CCodeParser();
virtual ~CCodeParser();
~CCodeParser() override;
NON_COPYABLE(CCodeParser)
void parseCode(OutputCodeList &codeOutIntf,
const QCString &scopeName,
Expand All @@ -46,8 +46,8 @@ class CCodeParser : public CodeParserInterface
bool showLineNumbers=TRUE,
const Definition *searchCtx=nullptr,
bool collectXRefs=TRUE
);
void resetCodeParserState();
) override;
void resetCodeParserState() override;
void setInsideCodeLine(bool inp);
bool insideCodeLine() const;
private:
Expand Down

0 comments on commit 826d963

Please sign in to comment.