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:
Sean Callanan
2014-02-19 23:37:25 +00:00
parent 68893db056
commit 92cdbc8f2d

View File

@@ -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;
}