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:
parent
10cfd0dfb3
commit
9a41478465
2 changed files with 4 additions and 5 deletions
|
@ -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$
|
||||
}
|
||||
|
|
|
@ -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--;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue