Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java10
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java2
2 files changed, 12 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
index a4f8afe32e1..c297ee96fb9 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/includes/BindingClassifierTest.java
@@ -631,4 +631,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();
+ }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
index 199c09434af..8d6a20334ef 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/BindingClassifier.java
@@ -693,6 +693,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) {

Back to the top