C++: Fix crash in auto deducing mechanism

There was an inconsistency, since the AST used in ResolveExpression
was not really the same previously computed. In the particular issue
below a crash could occur, for example, when using auto in a for
range loop.

Task-number: QTCREATORBUG-7828
Change-Id: I02958f434c3cf3b50609546003fc141674ee78d5
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Leandro Melo
2012-09-05 14:26:11 +02:00
committed by Eike Ziller
parent efa91f005b
commit c5097ed183
2 changed files with 48 additions and 14 deletions

View File

@@ -121,18 +121,11 @@ protected:
private:
struct IdentifierComp
{
bool operator()(const Identifier *a, const Identifier *b) const
{ return strcmp(a->chars(), b->chars()) < 0; }
};
Scope *_scope;
LookupContext _context;
Bind bind;
QList<LookupItem> _results;
bool _reference;
std::set<const Identifier *, IdentifierComp> _blockedIds; // Replace by a hash impl.
};
} // namespace CPlusPlus