aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/TypePrettyPrinter.cpp
diff options
context:
space:
mode:
authorDmitry Ashkadov <dmitry.ashkadov@gmail.com>2014-11-13 22:18:53 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-06-22 17:47:59 +0000
commit43075f5fb165e764f11abd35c4cc06cbda969a20 (patch)
treeec7a69d1a1a4d72bb7d3d0a9eb2d342b7afcc650 /src/libs/cplusplus/TypePrettyPrinter.cpp
parentc0f3094866923f27692e654f94cd55546f5c87d5 (diff)
C++: Add support of ref-qualifier for functions.
Now the ref-qualifier (& or &&) of the function declaration is propagated to GUI. For example, 'Refactor' -> 'Add Definition' preserves the ref-qualifier. Change-Id: I8ac4e1cad4e44985e94230aabbd9858a7e929fee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/cplusplus/TypePrettyPrinter.cpp')
-rw-r--r--src/libs/cplusplus/TypePrettyPrinter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index 282deb830e..e3693f17a0 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -454,6 +454,17 @@ void TypePrettyPrinter::visit(Function *type)
appendSpace();
_text += QLatin1String("volatile");
}
+
+ // add ref-qualifier
+ if (type->refQualifier() != Function::NoRefQualifier) {
+ if (!_overview->starBindFlags.testFlag(Overview::BindToLeftSpecifier)
+ || (!type->isConst() && !type->isVolatile())) {
+ appendSpace();
+ }
+ _text += type->refQualifier() == Function::LvalueRefQualifier
+ ? QLatin1String("&")
+ : QLatin1String("&&");
+ }
}
}