From f69b77089b69fc2d564fdacc51d27cd7c85f0c28 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 29 Dec 2015 20:06:31 -0500 Subject: [PATCH] Bug 467332 - Disambiguation inside noexcept-specifier Change-Id: I5bc7378bd050f3c13753dc98970c4e510f53caf5 Signed-off-by: Nathan Ridge --- .../core/parser/tests/ast2/AST2TemplateTests.java | 12 ++++++++++++ .../dom/parser/cpp/CPPASTFunctionDeclarator.java | 6 ++++++ 2 files changed, 18 insertions(+) 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 c0307919e54..b1f5f80b0a0 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 @@ -8980,4 +8980,16 @@ public class AST2TemplateTests extends AST2TestBase { public void testRecursiveTemplateClass_484786() throws Exception { parseAndCheckBindings(); } + + // template + // struct S { + // static const bool value = true; + // }; + // + // typedef int Int; + // + // void waldo() noexcept(S::value) {} + public void testDisambiguationInNoexceptSpecifier_467332() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java index 9282028e468..53fe209c5bb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java @@ -314,6 +314,12 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS } } } + if (child == noexceptExpression) { + other.setPropertyInParent(child.getPropertyInParent()); + other.setParent(child.getParent()); + noexceptExpression = (ICPPASTExpression) other; + return; + } assert false; }