Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2017-01-28 01:22:23 -0500
committerNathan Ridge2017-02-10 21:30:29 -0500
commit2363e0ac1118656294b5b19477ecb4aa1388abe5 (patch)
tree08e57776dd37ac8907ec51642682c06360a2bdc6
parentc1ef041828b5c454f9099875a12a77249a590f84 (diff)
downloadorg.eclipse.cdt-2363e0ac1118656294b5b19477ecb4aa1388abe5.tar.gz
org.eclipse.cdt-2363e0ac1118656294b5b19477ecb4aa1388abe5.tar.xz
org.eclipse.cdt-2363e0ac1118656294b5b19477ecb4aa1388abe5.zip
Bug 511186 - Noexcept specifier in type template argument
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
index b07c15764e..c2ad03351a 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
@@ -9955,4 +9955,10 @@ public class AST2TemplateTests extends AST2TestBase {
public void testInstantiationOfEvalIdWithFieldOwner_511108() throws Exception {
parseAndCheckBindings();
}
+
+ // template <typename> struct Waldo {};
+ // Waldo<void() noexcept> var;
+ public void testNoexceptSpecifierInTypeTemplateArgument_511186() 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 485d46b8f1..2db2698774 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
@@ -4633,10 +4633,11 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
if (LT(1) == IToken.tLPAREN) {
consume(); // (
expression = expression();
- endOffset = consume(IToken.tRPAREN).getEndOffset(); //)
+ consume(IToken.tRPAREN); //)
} else {
expression = ICPPASTFunctionDeclarator.NOEXCEPT_DEFAULT;
}
+ endOffset = getEndOffset();
fc.setNoexceptExpression((ICPPASTExpression) expression);
}

Back to the top