diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
index aef22453035c30..21ee417da6028a 100644
--- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -352,6 +352,7 @@ genHTML(const EnumInfo &I, const ClangDocContext &CDCtx);
static std::vector>
genHTML(const FunctionInfo &I, const ClangDocContext &CDCtx,
StringRef ParentInfoDir);
+static std::unique_ptr genHTML(const std::vector &C);
static std::vector>
genEnumsBlock(const std::vector &Enums,
@@ -418,9 +419,13 @@ genRecordMembersBlock(const llvm::SmallVector &Members,
if (Access != "")
Access = Access + " ";
auto LIBody = std::make_unique(HTMLTag::TAG_LI);
- LIBody->Children.emplace_back(std::make_unique(Access));
- LIBody->Children.emplace_back(genReference(M.Type, ParentInfoDir));
- LIBody->Children.emplace_back(std::make_unique(" " + M.Name));
+ auto MemberDecl = std::make_unique(HTMLTag::TAG_DIV);
+ MemberDecl->Children.emplace_back(std::make_unique(Access));
+ MemberDecl->Children.emplace_back(genReference(M.Type, ParentInfoDir));
+ MemberDecl->Children.emplace_back(std::make_unique(" " + M.Name));
+ if (!M.Description.empty())
+ LIBody->Children.emplace_back(genHTML(M.Description));
+ LIBody->Children.emplace_back(std::move(MemberDecl));
ULBody->Children.emplace_back(std::move(LIBody));
}
return Out;
diff --git a/clang-tools-extra/test/clang-doc/basic-project.test b/clang-tools-extra/test/clang-doc/basic-project.test
index c2c7548f5a9690..2865ed4446e7ef 100644
--- a/clang-tools-extra/test/clang-doc/basic-project.test
+++ b/clang-tools-extra/test/clang-doc/basic-project.test
@@ -91,8 +91,10 @@
// HTML-RECTANGLE: Shape
// HTML-RECTANGLE:
// HTML-RECTANGLE: Members
-// HTML-RECTANGLE: private double width_
-// HTML-RECTANGLE: private double height_
+// HTML-RECTANGLE: Width of the rectangle.
+// HTML-RECTANGLE: private double width_
+// HTML-RECTANGLE: Height of the rectangle.
+// HTML-RECTANGLE: private double height_
// HTML-RECTANGLE: Functions
// HTML-RECTANGLE: Rectangle
// HTML-RECTANGLE: public void Rectangle(double width, double height)
@@ -112,7 +114,8 @@
// HTML-CIRCLE: Shape
// HTML-CIRCLE:
// HTML-CIRCLE: Members
-// HTML-CIRCLE: private double radius_
+// HTML-CIRCLE: Radius of the circle.
+// HTML-CIRCLE: private double radius_
// HTML-CIRCLE: Functions
// HTML-CIRCLE: Circle
// HTML-CIRCLE: public void Circle(double radius)
diff --git a/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
index e4a7340318b934..bd031282b042ab 100644
--- a/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
@@ -197,7 +197,9 @@ TEST(HTMLGeneratorTest, emitRecordHTML) {
Members
- - private int X
+ -
+
private int X
+
Records