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 c17ff949b1a..8a86010d10c 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/semanticHighlighting/SHTest.cpp @@ -127,3 +127,10 @@ label: SDKFunction(); return 0; } + +//http://bugs.eclipse.org/209203 +template +int f() +{ + return n; +} 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 30559e74098..26c70905eed 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 @@ -193,6 +193,8 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { createPosition(77, 27, 2), createPosition(83, 15, 2), createPosition(83, 66, 2), + createPosition(131, 14, 1), + createPosition(134, 9, 1), }; if (PRINT_POSITIONS) System.out.println(toString(actual)); assertEqualPositions(expected, actual); @@ -259,6 +261,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { createPosition(12, 12, 16), createPosition(19, 16, 10), createPosition(98, 8, 13), + createPosition(132, 4, 1), }; if (PRINT_POSITIONS) System.out.println(toString(actual)); assertEqualPositions(expected, actual); @@ -275,6 +278,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest { createPosition(98, 8, 13), createPosition(99, 1, 16), createPosition(126, 4, 11), + createPosition(132, 4, 1), }; 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 a2afa30a309..0b13e27b18e 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 @@ -48,6 +48,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndexBinding; @@ -936,6 +937,7 @@ public class SemanticHighlightings { if (binding instanceof IVariable && !(binding instanceof IField) && !(binding instanceof IParameter) + && !(binding instanceof ICPPTemplateNonTypeParameter) && !(binding instanceof IProblemBinding)) { try { IScope scope= binding.getScope();