mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Validated 39681 - Nested functions are not supported (GCC, C)
This commit is contained in:
parent
1b1480e7ba
commit
b6b0fda824
3 changed files with 26 additions and 18 deletions
|
@ -47,23 +47,7 @@ public class ASTFailedTests extends BaseASTTest
|
|||
{
|
||||
assertCodeFailsParse("Foo blat() return f(4) {}");
|
||||
}
|
||||
public void testBug39681() throws Exception
|
||||
{
|
||||
Writer code = new StringWriter();
|
||||
try
|
||||
{
|
||||
code.write("double\n");
|
||||
code.write("foo (double a, double b)\n");
|
||||
code.write("{\n");
|
||||
code.write(" double square (double z) { return z * z; }\n");
|
||||
code.write(" return square (a) + square (b);\n");
|
||||
code.write("}\n");
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
}
|
||||
parse(code.toString());
|
||||
}
|
||||
|
||||
|
||||
public void testBug39682() throws Exception
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ public class GCCCompleteParseExtensionsTest extends CompleteParseBaseTest {
|
|||
|
||||
public void testPredefinedSymbol_bug69791() throws Exception {
|
||||
Iterator i = parse("typedef __builtin_va_list __gnuc_va_list; \n").getDeclarations();//$NON-NLS-1$
|
||||
IASTTypedefDeclaration td = (IASTTypedefDeclaration) i.next();
|
||||
assertTrue( i.next() instanceof IASTTypedefDeclaration );
|
||||
assertFalse(i.hasNext());
|
||||
}
|
||||
|
||||
|
@ -177,4 +177,16 @@ public class GCCCompleteParseExtensionsTest extends CompleteParseBaseTest {
|
|||
code.write("double w = __imag__ x; // imaginary part of expression\n"); //$NON-NLS-1$
|
||||
parse(code.toString());
|
||||
}
|
||||
|
||||
public void testBug39681() throws Exception
|
||||
{
|
||||
Writer code = new StringWriter();
|
||||
code.write("double\n"); //$NON-NLS-1$
|
||||
code.write("foo (double a, double b)\n"); //$NON-NLS-1$
|
||||
code.write("{\n"); //$NON-NLS-1$
|
||||
code.write(" double square (double z) { return z * z; }\n"); //$NON-NLS-1$
|
||||
code.write(" return square (a) + square (b);\n"); //$NON-NLS-1$
|
||||
code.write("}\n"); //$NON-NLS-1$
|
||||
parse(code.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,4 +117,16 @@ public class GCCQuickParseExtensionsTest extends BaseASTTest {
|
|||
code.write("double w = __imag__ x; // imaginary part of expression\n"); //$NON-NLS-1$
|
||||
parse(code.toString());
|
||||
}
|
||||
|
||||
public void testBug39681() throws Exception
|
||||
{
|
||||
Writer code = new StringWriter();
|
||||
code.write("double\n"); //$NON-NLS-1$
|
||||
code.write("foo (double a, double b)\n"); //$NON-NLS-1$
|
||||
code.write("{\n"); //$NON-NLS-1$
|
||||
code.write(" double square (double z) { return z * z; }\n"); //$NON-NLS-1$
|
||||
code.write(" return square (a) + square (b);\n"); //$NON-NLS-1$
|
||||
code.write("}\n"); //$NON-NLS-1$
|
||||
parse(code.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue