diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2016-09-21 20:01:27 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-09-21 20:01:27 (GMT) |
commit | 9ef1bf94eef1af591c40102b930fef95250b8142 (patch) | |
tree | 38ec21af29d25dcec3db5961aa032dcc4e94058b /src | |
parent | e12ec76f044b07d4e4fe167c93103be2879abaca (diff) | |
download | Doxygen-9ef1bf94eef1af591c40102b930fef95250b8142.zip Doxygen-9ef1bf94eef1af591c40102b930fef95250b8142.tar.gz Doxygen-9ef1bf94eef1af591c40102b930fef95250b8142.tar.bz2 |
Bug 771152 - C++11 ref-qualifiers do not appear in Member Function Documentation section
Diffstat (limited to 'src')
-rw-r--r-- | src/arguments.cpp | 17 | ||||
-rw-r--r-- | src/arguments.h | 12 | ||||
-rw-r--r-- | src/context.cpp | 12 | ||||
-rw-r--r-- | src/defargs.l | 6 | ||||
-rw-r--r-- | src/memberdef.cpp | 8 | ||||
-rw-r--r-- | src/scanner.l | 9 | ||||
-rwxr-xr-x | src/util.cpp | 14 | ||||
-rw-r--r-- | src/xmlgen.cpp | 7 |
8 files changed, 77 insertions, 8 deletions
diff --git a/src/arguments.cpp b/src/arguments.cpp index 095aa96..a828dab 100644 --- a/src/arguments.cpp +++ b/src/arguments.cpp @@ -33,6 +33,7 @@ ArgumentList *ArgumentList::deepCopy() const argList->pureSpecifier = pureSpecifier; argList->trailingReturnType = trailingReturnType; argList->isDeleted = isDeleted; + argList->refQualifier = refQualifier; return argList; } @@ -63,6 +64,7 @@ ArgumentList *ArgumentList::unmarshal(StorageIntf *s) result->pureSpecifier = unmarshalBool(s); result->trailingReturnType = unmarshalQCString(s); result->isDeleted = unmarshalBool(s); + result->refQualifier = (RefQualifierType)unmarshalInt(s); return result; } @@ -81,13 +83,13 @@ void ArgumentList::marshal(StorageIntf *s,ArgumentList *argList) Argument *a; for (ali.toFirst();(a=ali.current());++ali) { - marshalQCString(s,a->attrib); - marshalQCString(s,a->type); - marshalQCString(s,a->canType); - marshalQCString(s,a->name); - marshalQCString(s,a->array); - marshalQCString(s,a->defval); - marshalQCString(s,a->docs); + marshalQCString(s,a->attrib); + marshalQCString(s,a->type); + marshalQCString(s,a->canType); + marshalQCString(s,a->name); + marshalQCString(s,a->array); + marshalQCString(s,a->defval); + marshalQCString(s,a->docs); marshalQCString(s,a->typeConstraint); } } @@ -96,6 +98,7 @@ void ArgumentList::marshal(StorageIntf *s,ArgumentList *argList) marshalBool(s,argList->pureSpecifier); marshalQCString(s,argList->trailingReturnType); marshalBool(s,argList->isDeleted); + marshalInt(s,(int)argList->refQualifier); } } diff --git a/src/arguments.h b/src/arguments.h index 555b573..3af7134 100644 --- a/src/arguments.h +++ b/src/arguments.h @@ -73,6 +73,13 @@ struct Argument QCString typeConstraint; /*!< Used for Java generics: \<T extends C\> */ }; +enum RefQualifierType +{ + RefQualifierNone, + RefQualifierLValue, + RefQualifierRValue +}; + /*! \brief This class represents an function or template argument list. * * This class also stores some information about member that is typically @@ -87,7 +94,8 @@ class ArgumentList : public QList<Argument> constSpecifier(FALSE), volatileSpecifier(FALSE), pureSpecifier(FALSE), - isDeleted(FALSE) + isDeleted(FALSE), + refQualifier(RefQualifierNone) { setAutoDelete(TRUE); } /*! Destroys the argument list */ ~ArgumentList() {} @@ -105,6 +113,8 @@ class ArgumentList : public QList<Argument> QCString trailingReturnType; /*! method with =delete */ bool isDeleted; + /*! C++11 ref qualifier */ + RefQualifierType refQualifier; static ArgumentList *unmarshal(StorageIntf *s); static void marshal(StorageIntf *s,ArgumentList *argList); diff --git a/src/context.cpp b/src/context.cpp index f2f1419..e13aa69 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -3969,6 +3969,8 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> s_inst.addProperty("parameters", &Private::parameters); s_inst.addProperty("hasConstQualifier", &Private::hasConstQualifier); s_inst.addProperty("hasVolatileQualifier",&Private::hasVolatileQualifier); + s_inst.addProperty("hasRefQualifierLValue", &Private::hasRefQualifierLValue); + s_inst.addProperty("hasRefQualifierRValue", &Private::hasRefQualifierRValue); s_inst.addProperty("trailingReturnType", &Private::trailingReturnType); s_inst.addProperty("extraTypeChars", &Private::extraTypeChars); s_inst.addProperty("templateDecls", &Private::templateDecls); @@ -4571,6 +4573,16 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> ArgumentList *al = getDefArgList(); return al ? al->volatileSpecifier : FALSE; } + TemplateVariant hasRefQualifierLValue() const + { + ArgumentList *al = getDefArgList(); + return al ? al->refQualifier==RefQualifierLValue : FALSE; + } + TemplateVariant hasRefQualifierRValue() const + { + ArgumentList *al = getDefArgList(); + return al ? al->refQualifier==RefQualifierRValue : FALSE; + } TemplateVariant trailingReturnType() const { ArgumentList *al = getDefArgList(); diff --git a/src/defargs.l b/src/defargs.l index b0607d8..a55ad27 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -479,6 +479,12 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" <FuncQual>"volatile" { g_argList->volatileSpecifier=TRUE; } +<FuncQual>"&" { + g_argList->refQualifier=RefQualifierLValue; + } +<FuncQual>"&&" { + g_argList->refQualifier=RefQualifierRValue; + } <FuncQual,TrailingReturn>"="{B}*"0" { g_argList->pureSpecifier=TRUE; BEGIN(FuncQual); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 952be64..05f8c94 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -357,6 +357,14 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) { ol.docify(" volatile"); } + if (defArgList->refQualifier==RefQualifierLValue) + { + ol.docify(" &"); + } + else if (defArgList->refQualifier==RefQualifierRValue) + { + ol.docify(" &&"); + } if (!defArgList->trailingReturnType.isEmpty()) { linkifyText(TextGeneratorOLImpl(ol), // out diff --git a/src/scanner.l b/src/scanner.l index 9c32666..a310f4f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4659,6 +4659,15 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) roundCount=0; BEGIN(CopyRound); } +<FuncQual>{BN}*"&" { + current->args += " &"; + current->argList->refQualifier=RefQualifierLValue; + } +<FuncQual>{BN}*"&&" { + current->args += " &&"; + current->argList->refQualifier=RefQualifierRValue; + } + <FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function lineCount() ; current->args += " = 0"; diff --git a/src/util.cpp b/src/util.cpp index 3593c9d..6f7703b 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -2268,6 +2268,8 @@ QCString argListToString(ArgumentList *al,bool useCanonicalType,bool showDefVals result+=")"; if (al->constSpecifier) result+=" const"; if (al->volatileSpecifier) result+=" volatile"; + if (al->refQualifier==RefQualifierLValue) result+=" &"; + else if (al->refQualifier==RefQualifierRValue) result+=" &&"; if (!al->trailingReturnType.isEmpty()) result+=" -> "+al->trailingReturnType; if (al->pureSpecifier) result+=" =0"; return removeRedundantWhiteSpace(result); @@ -3362,6 +3364,12 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, } } + if (srcAl->refQualifier != dstAl->refQualifier) + { + NOMATCH + return FALSE; // one member is has a different ref-qualifier than the other + } + // so far the argument list could match, so we need to compare the types of // all arguments. ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl); @@ -3795,6 +3803,12 @@ bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *sr } } + if (srcAl->refQualifier != dstAl->refQualifier) + { + NOMATCH + return FALSE; // one member is has a different ref-qualifier than the other + } + // so far the argument list could match, so we need to compare the types of // all arguments. ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl); diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index a00c17e..fe95c7a 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -620,6 +620,13 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (md->isInline()) t << "yes"; else t << "no"; t << "\""; + if (al->refQualifier!=RefQualifierNone) + { + t << " refqual=\""; + if (al->refQualifier==RefQualifierLValue) t << "lvalue"; else t << "rvalue"; + t << "\""; + } + if (md->isFinal()) { t << " final=\"yes\""; |