diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java index 50d5b8b6c1a..ccd86e57d21 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2012 IBM Corporation and others. + * Copyright (c) 2002, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -2057,7 +2057,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser { } List parms= outerTemplateParameterList(); - consume(IToken.tGT, IToken.tGT_in_SHIFTR); + if (LT(1) != IToken.tEOC) { + consume(IToken.tGT, IToken.tGT_in_SHIFTR); + } IASTDeclaration d = declaration(option); ICPPASTTemplateDeclaration templateDecl = nodeFactory.newTemplateDeclaration(d); setRange(templateDecl, offset, calculateEndOffset(d)); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractContentAssistTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractContentAssistTest.java index e39e48b2b2a..26db8a43f23 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractContentAssistTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractContentAssistTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -96,8 +96,8 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase { fCFile= null; super.tearDown(); } - - protected void assertContentAssistResults(int offset, int length, String[] expected, boolean isCompletion, boolean isTemplate, int compareType) throws Exception { + + protected void assertContentAssistResults(int offset, int length, String[] expected, boolean isCompletion, boolean isTemplate, boolean filterResults, int compareType) throws Exception { if (CTestPlugin.getDefault().isDebugging()) { System.out.println("\n\n\n\n\nTesting "+this.getClass().getName()); } @@ -116,10 +116,12 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase { long endTime= System.currentTimeMillis(); assertTrue(results != null); - if(isTemplate) { - results= filterResultsKeepTemplates(results); - } else { - results= filterResults(results, isCode); + if (filterResults) { + if (isTemplate) { + results= filterResultsKeepTemplates(results); + } else { + results= filterResults(results, isCode); + } } String[] resultStrings= toStringArray(results, compareType); Arrays.sort(expected); @@ -160,6 +162,10 @@ public abstract class AbstractContentAssistTest extends BaseUITestCase { } } + + protected void assertContentAssistResults(int offset, int length, String[] expected, boolean isCompletion, boolean isTemplate, int compareType) throws Exception { + assertContentAssistResults(offset, length, expected, isCompletion, isTemplate, true, compareType); + } protected void assertContentAssistResults(int offset, String[] expected, boolean isCompletion, int compareType) throws Exception { assertContentAssistResults(offset, 0, expected, isCompletion, false, compareType); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java index da4abfe8443..2b251130613 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2013 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1374,4 +1374,10 @@ public class CompletionTests extends AbstractContentAssistTest { final String[] expected= { "foo;" }; assertCompletionResults(fCursorOffset, expected, COMPARE_REP_STRINGS); } + + // template