CppEditor: Add basic tests for MoveDeclarationOutOfIf and MoveDeclarationOutOfWhile

Change-Id: I519428496c3139a0ff97ab28d291853eca19887d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
CppEditor: Fix stack overflow in quick fixes

The MoveDeclarationOutOfIf quick fix modified a IfStatementAST in case
there were several such ASTs in interface->path(). The resulting AST was
invalid (else_statement was pointing to 'this' afterwards), thus the
afterwards executed PointerDeclarationFormatter (an ASTVisitor) was not
able to finish his visit.

The actual problem was that op->pattern in the match() calls was not
reset.

Task-number: QTCREATORBUG-10919
Change-Id: Ifbcac73e75690321ef45b6d8c2dc32fcea236efa
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
CppEditor: Add basic test for skipping forward declarations on F2

Change-Id: I6f6982b2e07bb1277d805ce48160afb25f33c7ae
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
CppEditor: Skip also forward declarations of templates on F2

Task-number: QTCREATORBUG-20

Change-Id: If6349605e1f396e88c8e3e008328fc2cac8a4119
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>