mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=47752 <BR>
Fixed bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=64321
This commit is contained in:
parent
d0c897c1e9
commit
1193d6341a
2 changed files with 22 additions and 6 deletions
|
@ -1889,6 +1889,25 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
|
|||
writer.write( "blah3\n"); //$NON-NLS-1$
|
||||
writer.write( "};\n"); //$NON-NLS-1$
|
||||
writer.write( "e mye = blah;\n"); //$NON-NLS-1$
|
||||
parse( writer.toString().toString() );
|
||||
parse( writer.toString() );
|
||||
}
|
||||
|
||||
public void testBug47752() throws Exception
|
||||
{
|
||||
Writer writer = new StringWriter();
|
||||
writer.write( "class BBC\n"); //$NON-NLS-1$
|
||||
writer.write( "{\n"); //$NON-NLS-1$
|
||||
writer.write( "int x;\n"); //$NON-NLS-1$
|
||||
writer.write( "};\n"); //$NON-NLS-1$
|
||||
writer.write( "void func( BBC bar )\n"); //$NON-NLS-1$
|
||||
writer.write( "try\n"); //$NON-NLS-1$
|
||||
writer.write( "{\n"); //$NON-NLS-1$
|
||||
writer.write( "}\n"); //$NON-NLS-1$
|
||||
writer.write( "catch ( BBC error )\n"); //$NON-NLS-1$
|
||||
writer.write( "{\n"); //$NON-NLS-1$
|
||||
writer.write( " //... error handling code ...\n"); //$NON-NLS-1$
|
||||
writer.write( "}\n"); //$NON-NLS-1$
|
||||
parse( writer.toString() );
|
||||
assertEquals( callback.getReferences().size(), 2 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1094,9 +1094,6 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
hasFunctionBody = true;
|
||||
}
|
||||
|
||||
if( fromCatchHandler )
|
||||
return null;
|
||||
|
||||
if( hasFunctionTryBlock && ! hasFunctionBody )
|
||||
throw backtrack;
|
||||
}
|
||||
|
@ -1122,7 +1119,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
}
|
||||
if (i.hasNext()) // no need to do this unless we have a declarator
|
||||
{
|
||||
if (!hasFunctionBody)
|
||||
if (!hasFunctionBody || fromCatchHandler)
|
||||
{
|
||||
IASTDeclaration declaration = null;
|
||||
while (i.hasNext())
|
||||
|
|
Loading…
Add table
Reference in a new issue