From 15a67c41c3c9640fd935e6c76818157afaf5a487 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Wed, 22 Aug 2012 16:26:49 +0200 Subject: [PATCH] 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 --- src/libs/3rdparty/cplusplus/Bind.cpp | 7 +++---- 1 file 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); }