diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index c253b67d6f0..b41138487a3 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -2124,6 +2124,18 @@ public class CompleteParseASTTest extends CompleteParseBaseTest parse( writer.toString() ); } + public void testBug71733() throws Exception + { + Writer writer = new StringWriter(); + writer.write( "void foo( int );\n"); + writer.write( "#define BLAH() \\\n"); + writer.write( " foo ( /* slash / is misinterpreted as end of comment */ \\\n"); + writer.write( " 4 );\n"); + writer.write( "int f() { BLAH() }\n"); + parse( writer.toString() ); + assertEquals( callback.getReferences().size(), 1 ); + } + public void testBug69526() throws Exception { Writer writer = new StringWriter(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java index b4732053c55..32d2f951afb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java @@ -1819,7 +1819,7 @@ public class Scanner2 implements IScanner, IScannerData { if( text[i] == '/' && ( i+1 < text.length ) && text[i+1] == '*') { i += 2; - while( i < text.length && text[i] != '*' && i+1 < text.length && text[i+1] != '/') + while( i < text.length && !(text[i] == '*' && i+1 < text.length && text[i+1] == '/')) ++i; ++i; }