Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java2
2 files changed, 9 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java
index fbaae3ff4d..6a4f372377 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java
@@ -76,4 +76,11 @@ public class ASTCPPSpecDefectTests extends AST2TestBase {
parseAndCheckBindings();
}
+ // auto f(int x, int y) -> decltype(x < y ? x : y) {
+ // return x < y ? x : y;
+ // }
+ public void testUnparenthesizedConditionalExpressionInTrailingReturnType_544818() throws Exception {
+ parseAndCheckBindings();
+ }
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
index b58abf0c40..cf8815ba4f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
@@ -621,6 +621,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
}
}
return AMBIGUOUS_TEMPLATE_ID;
+ } catch (EndOfFileException ignored) {
+ return NO_TEMPLATE_ID;
} finally {
backup(mark);
}

Back to the top