diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 12b30ef738d..e259ce54acd 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -292,7 +292,7 @@ void SearchSymbols::appendItem(const QString &symbolName, const QString &symbolT const QString &symbolScope, ModelItemInfo::ItemType itemType, Symbol *symbol) { - if (!symbol->name()) + if (!symbol->name() || symbol->isGenerated()) return; QString path = m_paths.value(symbol->fileId(), QString()); diff --git a/tests/cpplocators/testdata_basic/file1.cpp b/tests/cpplocators/testdata_basic/file1.cpp index 75c772cfb21..6db50704e4c 100644 --- a/tests/cpplocators/testdata_basic/file1.cpp +++ b/tests/cpplocators/testdata_basic/file1.cpp @@ -1,9 +1,13 @@ // Copyright header +#define GENERATE_FUNC void myFunctionGenerated() {} + // // Symbols in a global namespace // +GENERATE_FUNC + int myVariable; int myFunction(bool yesno, int number) {}