diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CIndenterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CIndenterTest.java index c0e3178f300..c0d5ad56c9c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CIndenterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CIndenterTest.java @@ -1043,4 +1043,15 @@ public class CIndenterTest extends BaseUITestCase { DefaultCodeFormatterConstants.INDENT_ON_COLUMN)); assertIndenterResult(); } + + //vector f() + //{ + //} + + //vector f() + //{ + //} + public void testIndentationAfterFunctionHeaderWithReturnTypeTemplateSpecification_Bug537568() throws Exception { + assertIndenterResult(); + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java index 177b1954643..85ba6a75d32 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java @@ -2229,6 +2229,12 @@ public final class CIndenter { while (skipPointerOperators()) { nextToken(); } + // skip template type specification of function return type + if (fToken == Symbols.TokenGREATERTHAN) { + if (!skipScope()) + return false; + nextToken(); + } switch (fToken) { case Symbols.TokenIDENT: return true;