1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 01:45:33 +02:00

Bug 537568: Apply correct indentation with template return types

Support optional template type specification of return type in method
declaration deduction.

Change-Id: Ibaa5d5128faefb0b95534918ba9980bd8449b851
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
This commit is contained in:
Andrey Mozzhuhin 2020-01-05 23:18:26 +03:00 committed by Jonah Graham
parent 4acce05305
commit bea8343e01
2 changed files with 17 additions and 0 deletions

View file

@ -1043,4 +1043,15 @@ public class CIndenterTest extends BaseUITestCase {
DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
assertIndenterResult();
}
//vector<int> f()
//{
//}
//vector<int> f()
//{
//}
public void testIndentationAfterFunctionHeaderWithReturnTypeTemplateSpecification_Bug537568() throws Exception {
assertIndenterResult();
}
}

View file

@ -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;