Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied [HEAD] Fully Qualified References Bugfixes

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. 

JohnC

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.92
diff -u -r1.92 ChangeLog
--- ChangeLog	12 Sep 2003 15:08:35 -0000	1.92
+++ ChangeLog	12 Sep 2003 19:11:02 -0000
@@ -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
 
Index: failures/org/eclipse/cdt/core/parser/failedTests/LokiFailures.java
===================================================================
RCS file: failures/org/eclipse/cdt/core/parser/failedTests/LokiFailures.java
diff -N failures/org/eclipse/cdt/core/parser/failedTests/LokiFailures.java
--- failures/org/eclipse/cdt/core/parser/failedTests/LokiFailures.java	17 Jul 2003 20:15:03 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -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() );
-	
-    }	
-}
Index: parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java,v
retrieving revision 1.17
diff -u -r1.17 QuickParseASTTests.java
--- parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	11 Sep 2003 18:06:15 -0000	1.17
+++ parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	12 Sep 2003 19:11:03 -0000
@@ -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;
@@ -1791,5 +1792,23 @@
 	{
 		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() );
+	}
+		
 		
 }
Index: suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java,v
retrieving revision 1.18
diff -u -r1.18 AutomatedIntegrationSuite.java
--- suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java	12 Sep 2003 13:13:44 -0000	1.18
+++ suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java	12 Sep 2003 19:11:03 -0000
@@ -27,7 +27,6 @@
 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 @@
 		
 		// Add all failed tests
 		suite.addTestSuite(ASTFailedTests.class);
-		suite.addTestSuite(LokiFailures.class);
 		suite.addTestSuite(STLFailedTests.class);
 		suite.addTestSuite(CModelElementsFailedTests.class);
 //		suite.addTestSuite(FailedCompleteParseASTExpressionTest.class);
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.123
diff -u -r1.123 ChangeLog
--- parser/ChangeLog	12 Sep 2003 18:36:36 -0000	1.123
+++ parser/ChangeLog	12 Sep 2003 19:10:32 -0000
@@ -1,4 +1,8 @@
 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 
 	
 2003-09-12 Andrew Niefer
Index: parser/org/eclipse/cdt/internal/core/parser/Parser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java,v
retrieving revision 1.107
diff -u -r1.107 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java	12 Sep 2003 18:36:36 -0000	1.107
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java	12 Sep 2003 19:10:34 -0000
@@ -936,7 +936,10 @@
             {
                 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 @@
                     throw backtrack;
                 }
             case IToken.tIDENTIFIER :
+            case IToken.tCOLONCOLON :
                 ITokenDuple duple = name();
                 //TODO should be an ID Expression really
                 try

Back to the top