From 65a29165c20d6a4546853eee11fd88eafb2250f6 Mon Sep 17 00:00:00 2001 From: sprigogin Date: Sat, 19 May 2012 20:56:22 -0700 Subject: [PATCH] Bug 370146 - No references in class defined in file containing inactive code that references a macro --- .../cdt/internal/core/parser/scanner/ScannerContext.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java index 5014289a94d..6a5a8a8431e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ScannerContext.java @@ -347,6 +347,11 @@ final class ScannerContext { } public void significantMacro(IMacroBinding macro) { + if (fCurrentState == CodeState.eParseInactive) { + // Macros in inactive code should not be considered significant to match behavior of indexer, + // which doesn't parse inactive code (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=370146). + return; + } final char[] macroName= macro.getNameCharArray(); if (fInternalModifications != null && !fInternalModifications.containsKey(macroName)) { final char[] expansion = macro.getExpansion();