mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
fix bug 44338
This commit is contained in:
parent
83c0dabdbd
commit
070f6eb80f
5 changed files with 55 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-04-07 Andrew Niefer
|
||||
fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=44338
|
||||
- added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTemplateTest.testBug44338()
|
||||
- added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTemplateTest.testBug44338_2()
|
||||
- added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTemplateTest.testBug44338_3()
|
||||
|
||||
2004-04-07 John Camelon
|
||||
Updated test cases that used IExpressionParser::expression().
|
||||
Added CompletionParseTest::testCompletionInFunctionBodyFullyQualified().
|
||||
|
|
|
@ -656,4 +656,47 @@ public class CompleteParseASTTemplateTest extends CompleteParseBaseTest {
|
|||
|
||||
parse( writer.toString () );
|
||||
}
|
||||
|
||||
public void testBug44338() throws Exception
|
||||
{
|
||||
Writer writer = new StringWriter();
|
||||
writer.write( "template < bool T > class A { ");
|
||||
writer.write( " void foo( bool b = T ); ");
|
||||
writer.write( "}; ");
|
||||
writer.write( "typedef A< 1 < 2 > A_TRUE; ");
|
||||
writer.write( "typedef A< ( 1 > 2 ) > A_FALSE; ");
|
||||
|
||||
Iterator i = parse( writer.toString() ).getDeclarations();
|
||||
|
||||
IASTTemplateDeclaration template = (IASTTemplateDeclaration) i.next();
|
||||
IASTTypedefDeclaration a_true = (IASTTypedefDeclaration) i.next();
|
||||
IASTTypedefDeclaration a_false = (IASTTypedefDeclaration) i.next();
|
||||
}
|
||||
|
||||
public void testBug44338_2() throws Exception
|
||||
{
|
||||
Writer writer = new StringWriter();
|
||||
writer.write( "template < int i > class X {}; ");
|
||||
writer.write( "template < class T > class Y {}; ");
|
||||
writer.write( "Y< X < 1 > > y1; ");
|
||||
writer.write( "Y< X < 6 >> 1 > > y2; ");
|
||||
|
||||
Iterator i = parse( writer.toString() ).getDeclarations();
|
||||
|
||||
IASTTemplateDeclaration templateX = (IASTTemplateDeclaration) i.next();
|
||||
IASTTemplateDeclaration templateY = (IASTTemplateDeclaration) i.next();
|
||||
IASTVariable y1 = (IASTVariable) i.next();
|
||||
IASTVariable y2 = (IASTVariable) i.next();
|
||||
}
|
||||
|
||||
public void testBug4338_3() throws Exception
|
||||
{
|
||||
try{
|
||||
//this is expected to fail the parse
|
||||
parse( "template < int i > class X {}; X< 1 > 2 > x; " );
|
||||
assertTrue( false );
|
||||
} catch ( ParserException e ){
|
||||
assertTrue( e.getMessage().equals( "FAILURE" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2004-04-07 Andrew Niefer
|
||||
fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=44338
|
||||
|
||||
2004-04-07 Andrew Niefer
|
||||
small changes to get through iostream under standard make with discovered symbols
|
||||
- check null pointer in GCCScannerExtension.handlePreprocessorDirective, the null is probably a symptom of whatever
|
||||
|
|
|
@ -175,7 +175,9 @@ public final class TemplateEngine {
|
|||
} else {
|
||||
Cost cost = null;
|
||||
try {
|
||||
cost = ParserSymbolTable.checkStandardConversionSequence( arg, param.getTypeInfo());
|
||||
TypeInfo info = new TypeInfo( param.getTypeInfo() );
|
||||
info.setType( info.getTemplateParameterType() );
|
||||
cost = ParserSymbolTable.checkStandardConversionSequence( arg, info );
|
||||
} catch (ParserSymbolTableException e) {
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,6 @@ public class TokenDuple implements ITokenDuple {
|
|||
if( ! iter.hasNext() )
|
||||
return token;
|
||||
|
||||
token = (IToken) iter.next();
|
||||
LinkedList scopes = new LinkedList();
|
||||
scopes.add( LT );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue