qdoc: Enable support for rvalue references in function signatures
qdoc interprets the double-ampersand in function parameters using rvalue references (e.g. 'Type &&other') incorrectly as a logical AND operator, resulting in a syntax error. This change works around the issue by treating '&' the same as '*', and defining Q_COMPILER_RVALUE_REFS for qdoc. Task-number: QTBUG-32675 Change-Id: I499611f16f22c33ff5b878da0cd59d67ddf53d72 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
parent
df7944e7d7
commit
0023774411
@ -14,7 +14,8 @@ defines += Q_QDOC \
|
|||||||
QT_DEPRECATED_* \
|
QT_DEPRECATED_* \
|
||||||
Q_NO_USING_KEYWORD \
|
Q_NO_USING_KEYWORD \
|
||||||
__cplusplus \
|
__cplusplus \
|
||||||
Q_COMPILER_INITIALIZER_LISTS
|
Q_COMPILER_INITIALIZER_LISTS \
|
||||||
|
Q_COMPILER_RVALUE_REFS
|
||||||
|
|
||||||
Cpp.ignoretokens += \
|
Cpp.ignoretokens += \
|
||||||
PHONON_EXPORT \
|
PHONON_EXPORT \
|
||||||
|
@ -237,7 +237,11 @@ int Tokenizer::getToken()
|
|||||||
return getTokenAfterPreprocessor();
|
return getTokenAfterPreprocessor();
|
||||||
case '&':
|
case '&':
|
||||||
yyCh = getChar();
|
yyCh = getChar();
|
||||||
if (yyCh == '&' || yyCh == '=') {
|
/*
|
||||||
|
Removed check for '&&', only interpret '&=' as an operator.
|
||||||
|
'&&' is also used for an rvalue reference. QTBUG-32675
|
||||||
|
*/
|
||||||
|
if (yyCh == '=') {
|
||||||
yyCh = getChar();
|
yyCh = getChar();
|
||||||
return Tok_SomeOperator;
|
return Tok_SomeOperator;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user