forked from qt-creator/qt-creator
C++: Fix regression when binding qualified names
This was introduced in function extraction refactoring intended
to fix an issue with invalid class names: a66e344b42
The patch fixes only the regression itself - the previous fix
is correct.
The report below consists two parts. The other one is not a
regression but nevertheless is fixed by the previous patch.
Task-number: QTCREATORBUG-7730
Change-Id: I6f65584902619b542c9ce56cd0f37218a3d50104
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
7
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
7
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -3131,13 +3131,12 @@ void Bind::ensureValidClassName(const Name **name, unsigned sourceLocation)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const QualifiedNameId *qName = (*name)->asQualifiedNameId();
|
const QualifiedNameId *qName = (*name)->asQualifiedNameId();
|
||||||
if (qName)
|
const Name *uqName = qName ? qName->name() : *name;
|
||||||
*name = qName->name();
|
|
||||||
|
|
||||||
if (!(*name)->isNameId() && !(*name)->isTemplateNameId()) {
|
if (!uqName->isNameId() && !uqName->isTemplateNameId()) {
|
||||||
translationUnit()->error(sourceLocation, "expected a class-name");
|
translationUnit()->error(sourceLocation, "expected a class-name");
|
||||||
|
|
||||||
*name = (*name)->identifier();
|
*name = uqName->identifier();
|
||||||
if (qName)
|
if (qName)
|
||||||
*name = control()->qualifiedNameId(qName->base(), *name);
|
*name = control()->qualifiedNameId(qName->base(), *name);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user