C++: Fix crash in typedef resolving

Task-number: QTCREATORBUG-9990

Change-Id: I8153f18c8b7402c5cb3edbe41098792be183de44
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>