1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 518271 - NPE when using Toggle function on a function containing a lambda expression

Change-Id: I441a627b0759655e865724bf5110fdb7dd8d5a50
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
This commit is contained in:
Marc-Andre Laperle 2018-09-21 23:04:30 -04:00 committed by Marc-André Laperle
parent 467dd174c3
commit 0b73bea05a
2 changed files with 25 additions and 0 deletions

View file

@ -3627,4 +3627,25 @@ public class ToggleRefactoringTest extends RefactoringTestBase {
public void testToggleWithVirtSpecifiersImplementationToClass_518273() throws Exception {
assertRefactoringSuccess();
}
//Test.h
//class Foo {
// void /*$*/foo/*$$*/() {
// []() {
//
// };
// }
//};
//====================
//class Foo {
// void foo();
//};
//
//inline void Foo::foo() {
// []() {
// };
//}
public void testToggleWithLambdaExpression_518271() throws Exception {
assertRefactoringSuccess();
}
}

View file

@ -48,6 +48,10 @@ public class InsertionPointFinder {
if (allafterdeclarations == null || alldefinitionsoutside == null)
return;
for(ICPPASTFunctionDeclarator decl: allafterdeclarations) {
if (decl.getName() == null) {
// Could be a lambda expression
continue;
}
String decl_name = decl.getName().toString();
for(ICPPASTFunctionDefinition def: alldefinitionsoutside) {
String def_name = null;