diff --git a/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp b/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp index f283f582948..98f555b7f2d 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp @@ -143,3 +143,6 @@ int f() //http://bugs.eclipse.org/220392 #define EMPTY EMPTY int f(); + +//http://bugs.eclipse.org/340492 +template< template class U > class myClass {}; diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java index baf8ac15377..a536a4bc77d 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -27,7 +27,7 @@ import org.eclipse.cdt.internal.ui.editor.SemanticHighlightings; */ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { - private static final boolean PRINT_POSITIONS= false; + private static final boolean PRINT_POSITIONS= true; private static final Class THIS= SemanticHighlightingTest.class; @@ -201,6 +201,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { createPosition(85, 66, 2), createPosition(136, 14, 1), createPosition(139, 9, 1), + createPosition(147, 32, 1), }; if (PRINT_POSITIONS) System.out.println(toString(actual)); assertEqualPositions(expected, actual); @@ -257,6 +258,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { createPosition(118, 4, 9), createPosition(120, 4, 8), createPosition(129, 4, 8), + createPosition(147, 42, 7), }; if (PRINT_POSITIONS) System.out.println(toString(actual)); assertEqualPositions(expected, actual); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java index e93a9654b38..8d872ecfa40 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -1226,7 +1226,7 @@ public class SemanticHighlightings { } if (node instanceof IASTName) { IBinding binding= token.getBinding(); - if (binding instanceof ICPPClassType) { + if (binding instanceof ICPPClassType && !(binding instanceof ICPPTemplateParameter)) { return true; } }