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 7d2815987cc..eb4b961ae3b 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 + // T bar(); + // struct S { + // void waldo(); + // }; + // int main() { + // auto L = [](S s) { return s; }; + // typedef decltype(L) lambda_type; + // decltype(bar()(S())) v; + // v.waldo(); + // } + public void testDecltypeWithConstantLambda_397494() throws Exception { + parseAndCheckBindings(); + } + // template // 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 14e1902fd42..979cc8fd7b3 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++) {