C++: Fix crash when deducing auto (with invalid ids)

Task-number: QTCREATORBUG-7801

Change-Id: I61436148ed1428a50a6840ba9109310a57dabaa4
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Leandro Melo
2012-09-04 15:21:03 +02:00
parent 8ba422d07c
commit 6750a1c829
6 changed files with 54 additions and 28 deletions

View File

@@ -36,6 +36,7 @@
#include <ASTVisitor.h>
#include <FullySpecifiedType.h>
#include <Bind.h>
#include <set>
namespace CPlusPlus {
@@ -118,12 +119,20 @@ protected:
// Objective-C expressions
virtual bool visit(ObjCMessageExpressionAST *ast);
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