1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

No default arguments in plain c, bug 263803.

This commit is contained in:
Markus Schorn 2009-02-06 14:38:51 +00:00
parent 10cfd0dfb3
commit 9a41478465
2 changed files with 4 additions and 5 deletions

View file

@ -137,7 +137,7 @@ public class AST2Tests extends AST2BaseTest {
}
public void testBug75340() throws Exception {
IASTTranslationUnit tu = parseAndCheckBindings("void f(int i = 0, int * p = 0);"); //$NON-NLS-1$
IASTTranslationUnit tu = parseAndCheckBindings("void f(int i = 0, int * p = 0);", ParserLanguage.CPP); //$NON-NLS-1$
IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0];
assertEquals(ASTSignatureUtil.getParameterSignature(sd.getDeclarators()[0]), "(int, int *)"); //$NON-NLS-1$
}

View file

@ -1775,7 +1775,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
try {
fPreventKnrCheck++;
declSpec= declSpecifierSeq(option);
declarator = initDeclarator(option);
declarator = declarator(option);
} catch(FoundDeclaratorException fd) {
declSpec= fd.declSpec;
declarator= fd.declarator;
@ -1783,9 +1783,8 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
altDeclarator= fd.altDeclarator;
backup(fd.currToken);
} catch (FoundAggregateInitializer lie) {
if (declSpec == null)
declSpec= lie.fDeclSpec;
declarator= addInitializer(lie);
declSpec= lie.fDeclSpec;
declarator= lie.fDeclarator;
} finally {
fPreventKnrCheck--;
}