mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 00:15:25 +02:00
Bug 443356 - Organize Includes adds an unnecessary include for a
function referenced by a macro
This commit is contained in:
parent
a5c99092dd
commit
62f4735f8e
2 changed files with 12 additions and 0 deletions
|
@ -648,4 +648,14 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
|
|||
assertDefined("MACRO");
|
||||
assertDeclared();
|
||||
}
|
||||
|
||||
// void f(int);
|
||||
// #define MACRO(name, arg) void name() { f(arg); }
|
||||
|
||||
// int bar;
|
||||
// MACRO(foo, bar);
|
||||
public void testMacro_4() throws Exception {
|
||||
assertDefined("MACRO");
|
||||
assertDeclared();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -692,6 +692,8 @@ public class BindingClassifier {
|
|||
*/
|
||||
IASTFunctionCallExpression functionCallExpression = (IASTFunctionCallExpression) expression;
|
||||
IASTExpression functionNameExpression = functionCallExpression.getFunctionNameExpression();
|
||||
if (isPartOfExternalMacroDefinition(functionNameExpression))
|
||||
return PROCESS_CONTINUE;
|
||||
|
||||
IBinding binding = getBindingOfExpression(functionNameExpression);
|
||||
if (binding != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue