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>
This commit is contained in:
Dmitry Ashkadov
2014-11-13 22:18:53 +03:00
committed by Orgad Shaneh
parent c0f3094866
commit 43075f5fb1
7 changed files with 176 additions and 0 deletions

View File

@@ -298,6 +298,12 @@ public:
InvokableMethod
};
enum RefQualifier {
NoRefQualifier, // a function declared w/o & and && => *this may be lvalue or rvalue
LvalueRefQualifier, // a function declared with & => *this is lvalue
RvalueRefQualifier // a function declared with && => *this is rvalue
};
public:
Function(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
Function(Clone *clone, Subst *subst, Function *original);
@@ -344,6 +350,9 @@ public:
bool isPureVirtual() const;
void setPureVirtual(bool isPureVirtual);
RefQualifier refQualifier() const;
void setRefQualifier(RefQualifier refQualifier);
bool isSignatureEqualTo(const Function *other, Matcher *matcher = 0) const;
bool isAmbiguous() const; // internal
@@ -384,6 +393,7 @@ private:
unsigned _isVolatile: 1;
unsigned _isAmbiguous: 1;
unsigned _methodKey: 3;
unsigned _refQualifier: 2;
};
union {
unsigned _flags;