diff options
author | Leandro Melo <[email protected]> | 2012-08-22 16:26:49 +0200 |
---|---|---|
committer | Leandro Melo <[email protected]> | 2012-08-23 14:32:58 +0200 |
commit | 15a67c41c3c9640fd935e6c76818157afaf5a487 (patch) | |
tree | d2c00c1006f53f6e403494cdc01f0fcdcf1cca63 /src/libs | |
parent | 11f6ae4a143c2669a443ebcee693b71c310cf564 (diff) |
C++: Fix regression when binding qualified names
This was introduced in function extraction refactoring intended
to fix an issue with invalid class names: a66e344b424643fce71c127fdfb0a21103ca0171
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 <[email protected]>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Bind.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index eb9ec735b27..222e74cbcf1 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -3131,13 +3131,12 @@ void Bind::ensureValidClassName(const Name **name, unsigned sourceLocation) return; const QualifiedNameId *qName = (*name)->asQualifiedNameId(); - if (qName) - *name = qName->name(); + const Name *uqName = qName ? qName->name() : *name; - if (!(*name)->isNameId() && !(*name)->isTemplateNameId()) { + if (!uqName->isNameId() && !uqName->isTemplateNameId()) { translationUnit()->error(sourceLocation, "expected a class-name"); - *name = (*name)->identifier(); + *name = uqName->identifier(); if (qName) *name = control()->qualifiedNameId(qName->base(), *name); } |