diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CommentTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CommentTests.java index ba9dee4fc05..cb53e45f9ff 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CommentTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CommentTests.java @@ -208,4 +208,15 @@ public class CommentTests extends AST2BaseTest { assertEquals("// comment1", new String(comments[0].getComment())); assertEquals("// comment2", new String(comments[1].getComment())); } + + // //comment + public void _testCommentLocation_bug186337() throws Exception{ + StringBuffer code= getContents(1)[0]; + IASTTranslationUnit tu = parse(code.toString(), ParserLanguage.CPP, false, true, true); + IASTComment[] comments = tu.getComments(); + + assertEquals(1, comments.length); + assertNotNull(comments[0].getFileLocation()); + assertNotNull(comments[0].getNodeLocations()); + } }