diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 8d74dd8bc9699..d324b864709da 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -70,6 +70,8 @@ AST Dumping Potentially Breaking Changes ``introduced``, ``deprecated``, ``obsoleted``, ``unavailable``, ``message``, ``strict``, ``replacement``, ``priority``, and ``environment``. Previously, these fields were missing from the JSON output. +- Colons that appear at the end of a ParamCommentCommand name are not serialized + as part of the name. Clang Frontend Potentially Breaking Changes ------------------------------------------- diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp index 2e5821a8e4436..68f18cfb5173e 100644 --- a/clang/lib/AST/CommentParser.cpp +++ b/clang/lib/AST/CommentParser.cpp @@ -299,6 +299,8 @@ class TextTokenRetokenizer { } else break; } + if (WordText.ends_with(':')) + WordText.pop_back(); const unsigned Length = WordText.size(); if (Length == 0) { Pos = SavedPos; diff --git a/clang/test/AST/ast-dump-comment.cpp b/clang/test/AST/ast-dump-comment.cpp index b5dbe2e317d8c..f0eb86c964dee 100644 --- a/clang/test/AST/ast-dump-comment.cpp +++ b/clang/test/AST/ast-dump-comment.cpp @@ -41,6 +41,7 @@ int Test_BlockCommandComment_WithArgs(); /// \param Aaa xxx /// \param [in,out] Bbb yyy +/// \param Ccc: zzz void Test_ParamCommandComment(int Aaa, int Bbb); // CHECK: FunctionDecl{{.*}}Test_ParamCommandComment // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0 @@ -49,6 +50,9 @@ void Test_ParamCommandComment(int Aaa, int Bbb); // CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1 // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" yyy" +// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Ccc" +// CHECK-NEXT: ParagraphComment +// CHECK-NEXT: TextComment{{.*}} Text=" zzz" /// \tparam Aaa xxx template class Test_TParamCommandComment;