.NAME Overloading of operators

.DESCRIPTION
The comma operator, && operator and the || operator 
shall not be overloaded. 

.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 func_dcltr] } {
		set func [::logiscope::treeDown $node 0]
		if { [::utilities::isTreeOperator $func operator] } {
			set opKind [::logiscope::treeDown $func 0]
			if { [::utilities::isTreeOperator $opKind op_and] ||
			     [::utilities::isTreeOperator $opKind op_or] ||
				 [::utilities::isTreeOperator $opKind op_comma] } {
				::logiscope::addViolation $node
				return 0
			}
		}
	}
	return 1
}
