diff options
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java')
-rw-r--r-- | core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 588efc8aaad..ba91a62cce2 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -36,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.IASTLabelStatement; import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTProblemDeclaration; import org.eclipse.cdt.core.dom.ast.IASTReturnStatement; import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier; import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration; @@ -5099,4 +5100,30 @@ public class AST2CPPTests extends AST2BaseTest { IASTCompoundStatement body = (IASTCompoundStatement) f.getBody(); assertEquals( body.getStatements().length, 3 ); } + + public void testBug107150() throws Exception { + StringBuffer buffer = new StringBuffer(); + buffer.append("#define FUNC_PROTOTYPE_PARAMS(list) list\r\n"); //$NON-NLS-1$ + buffer.append("int func1 FUNC_PROTOTYPE_PARAMS((int arg1)){\r\n"); //$NON-NLS-1$ + buffer.append("return 0;\r\n"); //$NON-NLS-1$ + buffer.append("}\r\n"); //$NON-NLS-1$ + buffer.append("int func2 FUNC_PROTOTYPE_PARAMS\r\n"); //$NON-NLS-1$ + buffer.append("((int arg1)){\r\n"); //$NON-NLS-1$ + buffer.append("return 0;\r\n"); //$NON-NLS-1$ + buffer.append("}\r\n"); //$NON-NLS-1$ + IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.CPP); + assertFalse( tu.getDeclarations()[1] instanceof IASTProblemDeclaration ); + + buffer = new StringBuffer(); + buffer.append("#define FUNC_PROTOTYPE_PARAMS(list) list\n"); //$NON-NLS-1$ + buffer.append("int func1 FUNC_PROTOTYPE_PARAMS((int arg1)){\n"); //$NON-NLS-1$ + buffer.append("return 0;\n"); //$NON-NLS-1$ + buffer.append("}\n"); //$NON-NLS-1$ + buffer.append("int func2 FUNC_PROTOTYPE_PARAMS\n"); //$NON-NLS-1$ + buffer.append("((int arg1)){\n"); //$NON-NLS-1$ + buffer.append("return 0;\n"); //$NON-NLS-1$ + buffer.append("}\n"); //$NON-NLS-1$ + tu = parse(buffer.toString(), ParserLanguage.CPP); + assertFalse( tu.getDeclarations()[1] instanceof IASTProblemDeclaration ); + } } |