Skip to content
Snippets Groups Projects
Commit 6178a44f authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Warning for using-directive in class scope.

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