mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 481070 - Parameter completion doesn't work inside lambda
Change-Id: I32b0cf54dd349e04fddca17f4141e7fee06f2562 Signed-off-by: Sergey Grant <sergey.grant@me.com>
This commit is contained in:
parent
31150e4af1
commit
85b481a99a
2 changed files with 11 additions and 1 deletions
|
@ -31,6 +31,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClosureType;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDeferredClassInstance;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknownScope;
|
||||
|
@ -115,6 +116,8 @@ public class AccessContext {
|
|||
binding = ((ICPPAliasTemplateInstance) binding).getTemplateDefinition();
|
||||
}
|
||||
IBinding owner = binding.getOwner();
|
||||
if (owner instanceof CPPClosureType)
|
||||
return true;
|
||||
if (owner instanceof ICPPClassType) {
|
||||
bindingVisibility = ((ICPPClassType) owner).getVisibility(binding);
|
||||
} else {
|
||||
|
|
|
@ -1401,6 +1401,13 @@ public class CompletionTests extends AbstractContentAssistTest {
|
|||
assertCompletionResults(fCursorOffset, expected, ID);
|
||||
}
|
||||
|
||||
// int par1;
|
||||
// auto x = [](int par2) { return par/*cursor*/
|
||||
public void testLambdaParameter_481070() throws Exception {
|
||||
final String[] expected= { "par1", "par2" };
|
||||
assertCompletionResults(fCursorOffset, expected, ID);
|
||||
}
|
||||
|
||||
// #define fooBar
|
||||
// #define foo_bar
|
||||
// fB/*cursor*/
|
||||
|
|
Loading…
Add table
Reference in a new issue