summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-01-29 20:03:04 (EST)
committer Sergey Prigogin2013-01-29 20:03:04 (EST)
commitad05d7423a6e82b702a2160ce227a7e0b958285b (patch)
tree7492a30774fc01302fc25635346f490c7f171adf
parentf2037f2ebb1c1843d99567e922671d855c3dc1f6 (diff)
downloadorg.eclipse.cdt-ad05d7423a6e82b702a2160ce227a7e0b958285b.zip
org.eclipse.cdt-ad05d7423a6e82b702a2160ce227a7e0b958285b.tar.gz
org.eclipse.cdt-ad05d7423a6e82b702a2160ce227a7e0b958285b.tar.bz2
Bug 397494 - Error evaluating decltype of constant lambda
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 cf82d2d..7488fbb 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
@@ -10088,6 +10088,21 @@ public class AST2CPPTests extends AST2TestBase {
helper.assertNonProblemOnFirstIdentifier("fint({vchar");
}
+ // 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++) {