summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-03-01 04:43:21 (EST)
committer Sergey Prigogin2013-03-03 21:33:50 (EST)
commit5eb0fb045160f1b8e5d700c089ffb93860356f7b (patch)
tree67b0475a9bf08e0c246889e8a2406ead0d670110
parentec7a25ee6da5561550013f21e6280d96edae5cd1 (diff)
downloadorg.eclipse.cdt-5eb0fb045160f1b8e5d700c089ffb93860356f7b.zip
org.eclipse.cdt-5eb0fb045160f1b8e5d700c089ffb93860356f7b.tar.gz
org.eclipse.cdt-5eb0fb045160f1b8e5d700c089ffb93860356f7b.tar.bz2
Bug 402085 - UnsupportedOperationException inrefs/changes/67/10767/3
ASTAmbiguousNode.getEvaluation() Change-Id: I0ccad524d9ca717fd7a68fc571baf704159760ab Reviewed-on: https://git.eclipse.org/r/10767 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java3
2 files changed, 14 insertions, 0 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 fb81412..0028d96 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
@@ -7310,6 +7310,17 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
helper.assertProblem("bind(s, 0, foo)", "bind");
}
+
+
+ // template<typename T>
+ // T forward(T);
+ // template <typename, typename S1, typename S2>
+ // int combine(S1&& r1, S2&& r2);
+ // template <typename S1, typename S2>
+ // auto combine(S1 r1, S2 r2) -> decltype(combine<int>(forward<S1>(r1), forward<S2>(r2)));
+ public void testUnsupportedOperationExceptionInASTAmbiguousNode_402085() throws Exception {
+ parseAndCheckBindings();
+ }
// template <bool... Args>
// struct ice_or;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index 126a1dd..1186983 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -699,6 +699,9 @@ public class CPPSemantics {
private static void getAssociatedScopes(IType t, Set<ICPPNamespaceScope> namespaces,
Set<ICPPFunction> friendFns, ObjectSet<IType> handled, CPPASTTranslationUnit tu) throws DOMException {
t = getNestedType(t, TDEF | CVTYPE | PTR | ARRAY | REF);
+ // No point getting namespaces associated with a dependent type - we don't know what they are yet.
+ if (CPPTemplates.isDependentType(t))
+ return;
if (t instanceof IBinding) {
if (handled.containsKey(t))
return;