CppEditor: Do not crash on doxygen comment creation

... for templates that were not parsed entirely successfully.
Amends a437539096.

Fixes: QTCREATORBUG-27207
Change-Id: I4d7935b30cac9ce14f442977d07417a343ecae11
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2022-03-22 11:13:27 +01:00
parent 638b93591b
commit 137d3367cf

View File

@@ -141,8 +141,10 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl)
{
if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration())
if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration();
templDecl && templDecl->declaration) {
decl = templDecl->declaration;
}
SpecifierAST *spec = nullptr;
DeclaratorAST *decltr = nullptr;