Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Bug Fixes to AST Handling
- Fix incorrect name qualifiers applied to alias CTAD. (#GH136624)
- Fixed ElaboratedTypes appearing within NestedNameSpecifier, which was not a
legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)
- Fix unrecognized html tag causing undesirable comment lexing (#GH152944)
- Fix comment lexing of special command names (#GH152943)

Miscellaneous Bug Fixes
Expand Down
5 changes: 5 additions & 0 deletions clang/include/clang/AST/CommentHTMLTags.td
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def Col : Tag<"col"> { let EndTagForbidden = 1; }
def Tr : Tag<"tr"> { let EndTagOptional = 1; }
def Th : Tag<"th"> { let EndTagOptional = 1; }
def Td : Tag<"td"> { let EndTagOptional = 1; }
def Summary : Tag<"summary">;
def Details : Tag<"details">;
def Mark : Tag<"mark">;
def Figure : Tag<"figure">;
def FigCaption : Tag<"figcaption">;

// Define a list of attributes that are not safe to pass through to HTML
// output if the input is untrusted.
Expand Down
42 changes: 42 additions & 0 deletions clang/test/AST/ast-dump-comment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,50 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ParagraphComment
// CHECK-NEXT: TextComment{{.*}} Text=" More arguments"

/// \param[out] Aaa <summary>Short summary</summary>
int Test_HTMLSummaryTag(int Aaa);
// CHECK: FunctionDecl{{.*}}Test_HTMLSummaryTag
// CHECK: ParamCommandComment{{.*}} [out] explicitly Param="Aaa"
// CHECK-NEXT: ParagraphComment
// CHECK: HTMLStartTagComment{{.*}} Name="summary"
// CHECK-NEXT: TextComment{{.*}} Text="Short summary"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="summary"

/// \thread_safe test for underscore in special command
int Test_UnderscoreInSpecialCommand;
// CHECK: VarDecl{{.*}}Test_UnderscoreInSpecialCommand 'int'
// CHECK: InlineCommandComment{{.*}} Name="thread_safe" RenderNormal
// CHECK-NEXT: TextComment{{.*}} Text=" test for underscore in special command"

/// <details>
/// <summary>
/// Summary
/// </summary>
/// <p>Details</p>
/// </details>
///
/// Some <mark>highlighting</mark>
///
/// <figure>
/// <img src="pic.jpg">
/// <figcaption>Figure 1</figcaption>
/// </figure>
int Test_AdditionalHTMLTags(int Aaa);
// CHECK: FunctionDecl{{.*}}Test_AdditionalHTMLTags 'int (int)'
// CHECK: HTMLStartTagComment{{.*}} Name="details"
// CHECK: HTMLStartTagComment{{.*}} Name="summary"
// CHECK-NEXT: TextComment{{.*}} Text=" Summary"
// CHECK: HTMLEndTagComment{{.*}} Name="summary"
// CHECK: HTMLStartTagComment{{.*}} Name="p"
// CHECK-NEXT: TextComment{{.*}} Text="Details"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="p"
// CHECK: HTMLEndTagComment{{.*}} Name="details"
// CHECK: HTMLStartTagComment{{.*}} Name="mark"
// CHECK-NEXT: TextComment{{.*}} Text="highlighting"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="mark"
// CHECK: HTMLStartTagComment{{.*}} Name="figure"
// CHECK: HTMLStartTagComment{{.*}} Name="img" Attrs: "src="pic.jpg"
// CHECK: HTMLStartTagComment{{.*}} Name="figcaption"
// CHECK-NEXT: TextComment{{.*}} Text="Figure 1"
// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="figcaption"
// CHECK: HTMLEndTagComment{{.*}} Name="figure"