mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
CORE
Fixed Bug 42985 : Search: Qualified function call is treated as a declaration Fixed Bug 40419 : parser fails on heavily templated expressions TESTS Created QuickParseASTTests::testBug42985(). Moved LokiFailures::testBug40419() to QuickParseASTTests. Deleted LokiFailures as it was empty.
This commit is contained in:
parent
277cbf5b68
commit
edd344b8af
6 changed files with 33 additions and 43 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-09-12 John Camelon
|
||||
Created QuickParseASTTests::testBug42985().
|
||||
Moved LokiFailures::testBug40419() to QuickParseASTTests.
|
||||
Deleted LokiFailures as it was empty.
|
||||
|
||||
2003-09-12 Andrew Niefer
|
||||
- added testBadParameterInfo to ParserSymbolTableTest
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2002,2003 Rational Software Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v0.5
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v05.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Rational Software - Initial API and implementation
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.core.parser.failedTests;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.eclipse.cdt.core.parser.tests.BaseASTTest;
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
public class LokiFailures extends BaseASTTest {
|
||||
|
||||
public LokiFailures(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void testBug40419()
|
||||
{
|
||||
Writer code = new StringWriter();
|
||||
try
|
||||
{
|
||||
code.write( "template <class T, class U> struct SuperSubclass {\n" );
|
||||
code.write( "enum { value = (::Loki::Conversion<const volatile U*, const volatile T*>::exists && \n" );
|
||||
code.write( "!::Loki::Conversion<const volatile T*, const volatile void*>::sameType) }; };" );
|
||||
} catch( IOException ioe ){}
|
||||
assertCodeFailsParse( code.toString() );
|
||||
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
* IBM Rational Software - Initial API and implementation
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.core.parser.tests;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
|
@ -1792,4 +1793,22 @@ public class QuickParseASTTests extends BaseASTTest
|
|||
parse("int* gp_down = static_cast<int*>(gp_stat);");
|
||||
}
|
||||
|
||||
public void testBug42985() throws Exception
|
||||
{
|
||||
parse( "const int x = 4; int y = ::x;");
|
||||
}
|
||||
|
||||
public void testBug40419() throws ParserException
|
||||
{
|
||||
Writer code = new StringWriter();
|
||||
try
|
||||
{
|
||||
code.write( "template <class T, class U> struct SuperSubclass {\n" );
|
||||
code.write( "enum { value = (::Loki::Conversion<const volatile U*, const volatile T*>::exists && \n" );
|
||||
code.write( "!::Loki::Conversion<const volatile T*, const volatile void*>::sameType) }; };" );
|
||||
} catch( IOException ioe ){}
|
||||
parse( code.toString() );
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.core.model.tests.BinaryTests;
|
|||
import org.eclipse.cdt.core.model.tests.ElementDeltaTests;
|
||||
import org.eclipse.cdt.core.model.tests.WorkingCopyTests;
|
||||
import org.eclipse.cdt.core.parser.failedTests.ASTFailedTests;
|
||||
import org.eclipse.cdt.core.parser.failedTests.LokiFailures;
|
||||
import org.eclipse.cdt.core.parser.failedTests.STLFailedTests;
|
||||
import org.eclipse.cdt.core.parser.tests.ParserTestSuite;
|
||||
import org.eclipse.cdt.core.search.tests.SearchTestSuite;
|
||||
|
@ -93,7 +92,6 @@ public class AutomatedIntegrationSuite extends TestSuite
|
|||
|
||||
// Add all failed tests
|
||||
suite.addTestSuite(ASTFailedTests.class);
|
||||
suite.addTestSuite(LokiFailures.class);
|
||||
suite.addTestSuite(STLFailedTests.class);
|
||||
suite.addTestSuite(CModelElementsFailedTests.class);
|
||||
// suite.addTestSuite(FailedCompleteParseASTExpressionTest.class);
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2003-09-12 John Camelon
|
||||
Fixed Bug 42985 : Search: Qualified function call is treated as a declaration
|
||||
Fixed Bug 40419 : parser fails on heavily templated expressions
|
||||
|
||||
2003-09-12 John Camelon
|
||||
Fixed Bug 43013 : IASTParameterDeclaration does not derive from IASTOffsetableNamedElement
|
||||
|
||||
|
|
|
@ -937,6 +937,9 @@ public class Parser implements IParser
|
|||
IASTDeclaration declaration = (IASTDeclaration)i.next();
|
||||
declaration.enterScope( requestor );
|
||||
|
||||
if ( !( declaration instanceof IASTScope ) )
|
||||
throw backtrack;
|
||||
|
||||
handleFunctionBody((IASTScope)declaration,
|
||||
sdw.isInline() );
|
||||
((IASTOffsetableElement)declaration).setEndingOffset(
|
||||
|
@ -4450,6 +4453,7 @@ public class Parser implements IParser
|
|||
throw backtrack;
|
||||
}
|
||||
case IToken.tIDENTIFIER :
|
||||
case IToken.tCOLONCOLON :
|
||||
ITokenDuple duple = name();
|
||||
//TODO should be an ID Expression really
|
||||
try
|
||||
|
|
Loading…
Add table
Reference in a new issue