summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-01-29 18:09:59 (EST)
committerSergey Prigogin2013-01-29 18:10:35 (EST)
commit0ef8976a2a4ae73d7f2009cf4fcaec6d8891c8be (patch)
tree9adcb3f258db1899c20084e0bdb9bd7467e9608d
parent047a6f8f298e30b56aaa210eef600c69acb7713d (diff)
downloadorg.eclipse.cdt-0ef8976a2a4ae73d7f2009cf4fcaec6d8891c8be.zip
org.eclipse.cdt-0ef8976a2a4ae73d7f2009cf4fcaec6d8891c8be.tar.gz
org.eclipse.cdt-0ef8976a2a4ae73d7f2009cf4fcaec6d8891c8be.tar.bz2
Bug 397494 - Error evaluating decltype of constant lambdarefs/changes/78/9478/3
Change-Id: Ib9f5b09d331db9b7686c7d1c3a0c124cb235131f Reviewed-on: https://git.eclipse.org/r/9478 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/AST2CPPTests.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java2
2 files changed, 16 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 7d28159..eb4b961 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -10125,6 +10125,21 @@ public class AST2CPPTests extends AST2TestBase {
parseAndCheckBindings(getAboveComment(), CPP, true);
}
+ // template <typename T>
+ // T bar();
+ // struct S {
+ // void waldo();
+ // };
+ // int main() {
+ // auto L = [](S s) { return s; };
+ // typedef decltype(L) lambda_type;
+ // decltype(bar<const lambda_type>()(S())) v;
+ // v.waldo();
+ // }
+ public void testDecltypeWithConstantLambda_397494() throws Exception {
+ parseAndCheckBindings();
+ }
+
// template <bool>
// struct enable_if {
// };
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
index 14e1902..979cc8f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
@@ -103,7 +103,7 @@ public class CPPClosureType extends PlatformObject implements ICPPClassType, ICP
// Function call operator
final IType returnType= getReturnType();
final IType[] parameterTypes= getParameterTypes();
- ft= new CPPFunctionType(returnType, parameterTypes, isMutable(), false, false);
+ ft= new CPPFunctionType(returnType, parameterTypes, !isMutable(), false, false);
ICPPParameter[] params = new ICPPParameter[parameterTypes.length];
for (int i = 0; i < params.length; i++) {