C++: Fix crash on auto deduction with debug enabled

By adding the expression document to the bindings object.

Since ResolveExpression is always initialized with the context of a
TypeOfExpression object, the symbols and names in the expression
document will at least live as long as the most outer TypeOfExpression
object.

Done-with: Orgad Shaneh <orgads@gmail.com>
Task-number: QTCREATORBUG-14253
Change-Id: Ia97c7401a2ada9a36113a04cf39e2283393421dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-05-15 14:14:18 +02:00
committed by Orgad Shaneh
parent 8ae18a9ca8
commit f27aa09ac5
4 changed files with 11 additions and 32 deletions

View File

@@ -119,6 +119,10 @@ public:
QSharedPointer<Control> control() const
{ return _control; }
/// Adds an expression document in order to keep their symbols and names alive
void addExpressionDocument(Document::Ptr document)
{ _expressionDocuments.append(document); }
bool expandTemplates() const
{ return _expandTemplates; }
void setExpandTemplates(bool expandTemplates)
@@ -185,6 +189,7 @@ private:
Snapshot _snapshot;
QSharedPointer<Control> _control;
QList<Document::Ptr> _expressionDocuments;
QSet<Namespace *> _processed;
QList<LookupScope *> _entities;
LookupScope *_globalNamespace;