1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Bug 544818: Unparenthesized conditional expressions in trailing return

type causes parse error

Change-Id: I55131a2f1b6c6eec674f4f298b320d31a78d2829
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=544818
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
This commit is contained in:
Felix Morgner 2019-02-26 13:24:28 +01:00
parent e153fa920d
commit 480af1ddb1
2 changed files with 9 additions and 0 deletions

View file

@ -76,4 +76,11 @@ public class ASTCPPSpecDefectTests extends AST2TestBase {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// auto f(int x, int y) -> decltype(x < y ? x : y) {
// return x < y ? x : y;
// }
public void testUnparenthesizedConditionalExpressionInTrailingReturnType_544818() throws Exception {
parseAndCheckBindings();
}
} }

View file

@ -621,6 +621,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
} }
} }
return AMBIGUOUS_TEMPLATE_ID; return AMBIGUOUS_TEMPLATE_ID;
} catch (EndOfFileException ignored) {
return NO_TEMPLATE_ID;
} finally { } finally {
backup(mark); backup(mark);
} }