.NAME C-style casts

.DESCRIPTION
C-style casts (other than void casts) and functional 
notation casts (other than explicit constructor calls) 
shall not be used. 

.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
  # Look for overloaded opeators
  utilities::filterTree $tree [list [namespace current]::check]
}

proc check { node } {
	if { [::utilities::isTreeOperator $node cast] } {
		set type_id [::logiscope::treeDown $node 0]
		if { [::utilities::isTreeOperator $type_id type_id] } {
			set type_specifiers [::logiscope::treeDown $type_id 0]
			if { [::utilities::isTreeOperator $type_specifiers type_specifiers] } {
				set typespec [::logiscope::treeDown $type_specifiers 0]
				if { [::utilities::isTreeOperator $typespec typespec] } {
					set type [::utilities::treeAtomString $typespec]
					if { "$type" == "void" } {
						return 0
					}
				}
			}
		}
 	    ::logiscope::addViolation $node
	}
	return 1
}	
