diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index 7e2710f8d28..21546557495 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -368,11 +368,7 @@ void Lexer::scan_helper(Token *tok) if (_yychar == '/' || _yychar == '!') { yyinp(); - - if (_yychar == '<' || _yychar != '/') { - yyinp(); - doxy = true; - } + doxy = true; } while (_yychar && _yychar != '\n') diff --git a/tests/auto/cplusplus/lexer/tst_lexer.cpp b/tests/auto/cplusplus/lexer/tst_lexer.cpp index 993cfe9782c..f71a40631c4 100644 --- a/tests/auto/cplusplus/lexer/tst_lexer.cpp +++ b/tests/auto/cplusplus/lexer/tst_lexer.cpp @@ -65,7 +65,7 @@ void tst_SimpleLexer::doxygen_comments() Token expectedToken; // Create a Token in order to spell the token kind expectedToken.f.kind = expectedTokenKind; // qDebug("Comparing (i=%d): \"%s\" \"%s\"", i, token.spell(), expectedToken.spell()); - QCOMPARE(token.spell(), expectedToken.spell()); + QCOMPARE(token.kind(), expectedTokenKind); } QVERIFY2(i == expectedTokenKindList.size(), "Less tokens than expected."); } @@ -83,7 +83,7 @@ void tst_SimpleLexer::doxygen_comments_data() QTest::newRow(source) << source << expectedTokenKindList; source = "//// comment"; - expectedTokenKindList = QList() << T_CPP_COMMENT; + expectedTokenKindList = QList() << T_CPP_DOXY_COMMENT; QTest::newRow(source) << source << expectedTokenKindList; source = "/// comment"; @@ -105,6 +105,13 @@ void tst_SimpleLexer::doxygen_comments_data() source = "///\n"; expectedTokenKindList = QList() << T_CPP_DOXY_COMMENT; QTest::newRow(source) << source << expectedTokenKindList; + + source = "///\n" + "int i;"; + expectedTokenKindList = QList() + << T_CPP_DOXY_COMMENT + << T_INT << T_IDENTIFIER << T_SEMICOLON; + QTest::newRow(source) << source << expectedTokenKindList; } QTEST_APPLESS_MAIN(tst_SimpleLexer)