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();