Author: gribozavr
Date: Fri Jul 6 18:27:33 2012
New Revision: 159878
URL: http://llvm.org/viewvc/llvm-project?rev=159878&view=rev
Log:
Restrict the set of declaration kinds for which we allow trailing comments.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/Index/annotate-comments.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=159878&r1=159877&r2=159878&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Jul 6 18:27:33 2012
@@ -99,7 +99,7 @@
// First check whether we have a trailing comment.
if (Comment != RawComments.end() &&
(*Comment)->isDocumentation() && (*Comment)->isTrailingComment() &&
- !isa<TagDecl>(D) && !isa<NamespaceDecl>(D)) {
+ (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D))) {
std::pair<FileID, unsigned> CommentBeginDecomp
= SourceMgr.getDecomposedLoc((*Comment)->getSourceRange().getBegin());
// Check that Doxygen trailing comment comes after the declaration, starts
Modified: cfe/trunk/test/Index/annotate-comments.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments.cpp?rev=159878&r1=159877&r2=159878&view=diff
==============================================================================
--- cfe/trunk/test/Index/annotate-comments.cpp (original)
+++ cfe/trunk/test/Index/annotate-comments.cpp Fri Jul 6 18:27:33 2012
@@ -95,11 +95,11 @@
/** But there are other blocks that are part of the comment, too.
IS_DOXYGEN_END */
void isdoxy20(int);
-void isdoxy21(int); ///< This is a member comment. isdoxy21 IS_DOXYGEN_SINGLE
+void notdoxy21(int); ///< This is a member comment. isdoxy21
IS_DOXYGEN_NOT_ATTACHED
-void isdoxy22(int); /*!< This is a member comment. isdoxy22 IS_DOXYGEN_SINGLE
*/
+void notdoxy22(int); /*!< This is a member comment. isdoxy22
IS_DOXYGEN_NOT_ATTACHED */
-void isdoxy23(int); /**< This is a member comment. isdoxy23 IS_DOXYGEN_SINGLE
*/
+void notdoxy23(int); /**< This is a member comment. isdoxy23
IS_DOXYGEN_NOT_ATTACHED */
void notdoxy24(int); // NOT_DOXYGEN
@@ -248,9 +248,6 @@
// CHECK: annotate-comments.cpp:80:5: FunctionDecl=isdoxy18:{{.*}} isdoxy18
IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:90:6: FunctionDecl=isdoxy19:{{.*}} isdoxy19
IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
// CHECK: annotate-comments.cpp:96:6: FunctionDecl=isdoxy20:{{.*}} isdoxy20
IS_DOXYGEN_START{{.*}} IS_DOXYGEN_END
-// CHECK: annotate-comments.cpp:98:6: FunctionDecl=isdoxy21:{{.*}} isdoxy21
IS_DOXYGEN_SINGLE
-// CHECK: annotate-comments.cpp:100:6: FunctionDecl=isdoxy22:{{.*}} isdoxy22
IS_DOXYGEN_SINGLE
-// CHECK: annotate-comments.cpp:102:6: FunctionDecl=isdoxy23:{{.*}} isdoxy23
IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:107:8: StructDecl=isdoxy25:{{.*}}
IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:112:7: FieldDecl=isdoxy26:{{.*}}
IS_DOXYGEN_SINGLE
// CHECK: annotate-comments.cpp:116:7: FieldDecl=isdoxy27:{{.*}}
IS_DOXYGEN_SINGLE
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits