From 11aa09fac29b0a21c422bd3b4db7f0372832ad3c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 29 Dec 2017 19:18:40 -0800 Subject: [PATCH] Don't reject macro definitions in system headers Before, an assert() macro expansion jumps to __assert_fail but not assert. This is because OnIndexReference finds a reference to __assert_fail but VisitMacroDefinitionAndExpansions rejects the expansion. --- src/indexer.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/indexer.cc b/src/indexer.cc index 8291bcff..2505cd41 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -923,9 +923,6 @@ ClangCursor::VisitResult VisitMacroDefinitionAndExpansions(ClangCursor cursor, // Resolve location, find IndexFile instance. CXSourceRange cx_source_range = clang_Cursor_getSpellingNameRange(cursor.cx_cursor, 0, 0); - CXSourceLocation start = clang_getRangeStart(cx_source_range); - if (clang_Location_isInSystemHeader(start)) - break; CXFile file; Range decl_loc_spelling = Resolve(cx_source_range, &file); IndexFile* db = ConsumeFile(param, file);