.NAME using directives

.DESCRIPTION
using-directives and using-declarations (excluding class 
scope or function scope using-declarations) shall not be 
used in header files. 

.COMMENT V7.0

.SEVERITY Required

.COMMENT
Please refer to the MISRA C++:2008 document for further details (www.misra-cpp.com)

.COMMAND tcl

.CODE

::logiscope::include -once common utilities.tcl

proc compute {standardName tree} {
  variable CurrentParameterList
  set fileName [::logiscope::fileName]
  set kind [file extension $fileName]
  if { "$kind" == ".h" || "$kind" == ".hh" || "$kind" == ".hxx" } {
	# Check all using_directive nodes
	utilities::filterTree $tree [list [namespace current]::check]
  }
}

proc check { node } {
	if { [::utilities::isTreeOperator $node using_directive] } {
	  ::logiscope::addViolation $node
	}
	return 1
}
