Comment AST: treat enumerators as "variables" in DeclInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161435 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h
index 981f22f..626ac8e 100644
--- a/include/clang/AST/Comment.h
+++ b/include/clang/AST/Comment.h
@@ -953,7 +953,8 @@
/// Something that we consider a "variable":
/// \li namespace scope variables;
- /// \li static and non-static class data members.
+ /// \li static and non-static class data members;
+ /// \li enumeratrs.
VariableKind,
/// A C++ namespace.
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index 96b09d0..de569d5 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -232,6 +232,7 @@
break;
case Decl::Var:
case Decl::Field:
+ case Decl::EnumConstant:
case Decl::ObjCIvar:
case Decl::ObjCAtDefsField:
Kind = VariableKind;
diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp
index 03aae9b..af026d6 100644
--- a/test/Index/annotate-comments.cpp
+++ b/test/Index/annotate-comments.cpp
@@ -428,6 +428,11 @@
}
}
+enum comment_to_xml_conversion_15 {
+ /// Aaa.
+ comment_to_xml_conversion_16
+};
+
#endif
// RUN: rm -rf %t
@@ -884,4 +889,4 @@
// CHECK: annotate-comments.cpp:422:5: VarDecl=comment_to_xml_conversion_12:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="422" column="5"><Name>comment_to_xml_conversion_12</Name><USR>c:@comment_to_xml_conversion_12</USR><Abstract><Para> Aaa.</Para></Abstract></Variable>]
// CHECK: annotate-comments.cpp:425:11: Namespace=comment_to_xml_conversion_13:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}annotate-comments.cpp" line="425" column="11"><Name>comment_to_xml_conversion_13</Name><USR>c:@N@comment_to_xml_conversion_13</USR><Abstract><Para> Aaa.</Para></Abstract></Namespace>]
// CHECK: annotate-comments.cpp:427:13: Namespace=comment_to_xml_conversion_14:{{.*}} FullCommentAsXML=[<Namespace file="{{[^"]+}}annotate-comments.cpp" line="427" column="13"><Name>comment_to_xml_conversion_14</Name><USR>c:@N@comment_to_xml_conversion_13@N@comment_to_xml_conversion_14</USR><Abstract><Para> Aaa.</Para></Abstract></Namespace>]
-
+// CHECK: annotate-comments.cpp:433:3: EnumConstantDecl=comment_to_xml_conversion_16:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}annotate-comments.cpp" line="433" column="3"><Name>comment_to_xml_conversion_16</Name><USR>c:@E@comment_to_xml_conversion_15@comment_to_xml_conversion_16</USR><Abstract><Para> Aaa.</Para></Abstract></Variable>]