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 751032afffc..482d09ebb11 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 @@ -420,4 +420,10 @@ public class SemanticHighlightingTest extends TestCase { public void testDependentMethodCall_379626() throws Exception { makeAssertions(); } + + // struct S {}; //$class + // struct S waldo; //$class,globalVariable + public void testCStructureName_451772() throws Exception { + makeAssertions(false /* parse as C file */); + } } 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 c7cdc84d96b..f99ca12ef61 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 @@ -30,6 +30,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTProblem; import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.IEnumeration; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IField; @@ -946,7 +947,7 @@ public class SemanticHighlightings { } if (node instanceof IASTName) { IBinding binding= token.getBinding(); - if (binding instanceof ICPPClassType && !(binding instanceof ICPPTemplateParameter)) { + if (binding instanceof ICompositeType && !(binding instanceof ICPPTemplateParameter)) { return true; } }