aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-05 08:45:00 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-11 19:01:50 +0000
commit0a8e37cd60863773940d9d7f21403a841d744720 (patch)
tree50cdcf32098bc4622576029c8c666a060a6ccbe5 /sources/shiboken2/ApiExtractor/abstractmetalang.cpp
parent6f5f279b49756b1f848a6d85fde6bcae5eef4937 (diff)
shiboken: Improve support for volatile
Previously, the volatile keyword ended up as a part of the qualified type name while parsing in translateType(). Add the token to TypeParser and add it to AbstractMetaType. Task-number: PYSIDE-672 Change-Id: I553ea1b35e7e99ffde4442471b82e32be84731ba Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 489d2e4aa..634eae5a0 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -114,6 +114,7 @@ void AbstractMetaAttributes::assignMetaAttributes(const AbstractMetaAttributes &
AbstractMetaType::AbstractMetaType() :
m_constant(false),
+ m_volatile(false),
m_cppInstantiation(true),
m_reserved(0)
{
@@ -156,6 +157,7 @@ AbstractMetaType *AbstractMetaType::copy() const
cpy->setTypeUsagePattern(typeUsagePattern());
cpy->setConstant(isConstant());
+ cpy->setVolatile(isVolatile());
cpy->setReferenceType(referenceType());
cpy->setIndirectionsV(indirectionsV());
cpy->setInstantiations(instantiations());
@@ -302,6 +304,8 @@ QDebug operator<<(QDebug d, const AbstractMetaType *at)
d << ", reftype=" << at->referenceType();
if (at->isConstant())
d << ", [const]";
+ if (at->isVolatile())
+ d << ", [volatile]";
if (at->isArray()) {
d << ", array of \"" << at->arrayElementType()->cppSignature()
<< "\", arrayElementCount=" << at->arrayElementCount();
@@ -2237,6 +2241,8 @@ QString AbstractMetaType::formatSignature(bool minimal) const
QString result;
if (isConstant())
result += QLatin1String("const ");
+ if (isVolatile())
+ result += QLatin1String("volatile ");
if (isArray()) {
// Build nested array dimensions a[2][3] in correct order
result += m_arrayElementType->minimalSignature();