Commit 6178a44f authored by Roberto Raggi's avatar Roberto Raggi

Warning for using-directive in class scope.

parent 7e10664e
......@@ -389,6 +389,11 @@ bool CheckDeclaration::visit(UsingDirectiveAST *ast)
UsingNamespaceDirective *u = control()->newUsingNamespaceDirective(ast->firstToken(), name);
ast->symbol = u;
_scope->enterSymbol(u);
if (! (_scope->isBlockScope() || _scope->isNamespaceScope()))
translationUnit()->error(ast->firstToken(),
"using-directive not within namespace or block scope");
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment