forked from qt-creator/qt-creator
CppEditor: Fix doxygen comment magic before templates
Fixes: QTCREATORBUG-9620 Change-Id: I65a434d72adbe72d449783a917444c2ee216fc5e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -326,6 +326,20 @@ void DoxygenTest::testBasic_data()
|
||||
"};\n"
|
||||
);
|
||||
|
||||
QTest::newRow("classTemplate") << _(
|
||||
"bool preventFolding;\n"
|
||||
"/**|\n"
|
||||
"template<typename T> class C {\n"
|
||||
"};\n"
|
||||
) << _(
|
||||
"bool preventFolding;\n"
|
||||
"/**\n"
|
||||
" * @brief The C class\n"
|
||||
" */\n"
|
||||
"template<typename T> class C {\n"
|
||||
"};\n"
|
||||
);
|
||||
|
||||
QTest::newRow("continuation_after_text_in_first_line") << _(
|
||||
"bool preventFolding;\n"
|
||||
"/*! leading comment|\n"
|
||||
|
@@ -141,6 +141,9 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
|
||||
|
||||
QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl)
|
||||
{
|
||||
if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration())
|
||||
decl = templDecl->declaration;
|
||||
|
||||
SpecifierAST *spec = nullptr;
|
||||
DeclaratorAST *decltr = nullptr;
|
||||
if (SimpleDeclarationAST *simpleDecl = decl->asSimpleDeclaration()) {
|
||||
|
Reference in New Issue
Block a user