summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/arguments.cpp17
-rw-r--r--src/arguments.h12
-rw-r--r--src/context.cpp12
-rw-r--r--src/defargs.l6
-rw-r--r--src/memberdef.cpp8
-rw-r--r--src/scanner.l9
-rwxr-xr-xsrc/util.cpp14
-rw-r--r--src/xmlgen.cpp7
-rw-r--r--templates/html/htmlmemdef.tpl2
-rw-r--r--templates/xml/compound.xsd8
10 files changed, 87 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\"";
diff --git a/templates/html/htmlmemdef.tpl b/templates/html/htmlmemdef.tpl
index 2b03a22..cb9c9e0 100644
--- a/templates/html/htmlmemdef.tpl
+++ b/templates/html/htmlmemdef.tpl
@@ -94,6 +94,8 @@
{{ member.extraTypeChars }}
{% if member.hasConstQualifier %} const {% endif %}
{% if member.hasVolatileQualifier %} volatile {% endif %}
+ {% if member.hasRefQualifierLValue %} &amp; {% endif %}
+ {% if member.hasRefQualifierRValue %} &amp;&amp; {% endif %}
{{ member.trailingReturnType }}
{% endif %}
{% endif %}
diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd
index c960c7b..f2ab42c 100644
--- a/templates/xml/compound.xsd
+++ b/templates/xml/compound.xsd
@@ -149,6 +149,7 @@
<xsd:attribute name="const" type="DoxBool" use="optional"/>
<xsd:attribute name="explicit" type="DoxBool" use="optional"/>
<xsd:attribute name="inline" type="DoxBool" use="optional"/>
+ <xsd:attribute name="refqual" type="DoxRefQualifierKind" use="optional"/>
<xsd:attribute name="virt" type="DoxVirtualKind" use="optional"/>
<xsd:attribute name="volatile" type="DoxBool" use="optional"/>
<xsd:attribute name="mutable" type="DoxBool" use="optional"/>
@@ -689,6 +690,13 @@
</xsd:restriction>
</xsd:simpleType>
+ <xsd:simpleType name="DoxRefQualifierKind">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="lvalue" />
+ <xsd:enumeration value="rvalue" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
<xsd:simpleType name="DoxLanguage">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Unknown" />