mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 07:39:11 +08:00
Emit a warning diagnostic if a symbol was promoted
to a variable. This helps people figure out what happened if they tried to do something to the variable and it didn't work because we gave it the default type of void*. llvm-svn: 201737
This commit is contained in:
@@ -1428,6 +1428,10 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
|
||||
|
||||
if (data_symbol)
|
||||
{
|
||||
std::string warning("got name from symbols: ");
|
||||
warning.append(name.AsCString());
|
||||
const unsigned diag_id = m_ast_context->getDiagnostics().getCustomDiagID(clang::DiagnosticsEngine::Level::Warning, "%0");
|
||||
m_ast_context->getDiagnostics().Report(diag_id) << warning.c_str();
|
||||
AddOneGenericVariable(context, *data_symbol, current_id);
|
||||
context.m_found.variable = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user