.NAME Exception object

.DESCRIPTION
	An exception object should not have pointer type. 

.COMMENT V7.0

.SEVERITY Advisory

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

.REQUIRED cpp_semantic

.COMMAND tcl

.CODE

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

proc compute {standardName tree} {
  # Check all ... nodes
  utilities::filterTree $tree [list [namespace current]::check]  
}

proc check {node} {
	if {[::utilities::isTreeOperator $node throw]} {
		set thrown [::logiscope::treeGetSon $node SIMPLE_EXPR_OPT]
		set thrownType [::Semantic::getTypeOf $thrown] 
		if { $thrownType != -1 } {
			set thrownTypeKind [::Semantic::getAttribute $thrownType typeKind]
			if {[expr [lsearch [list TypeReference TypePointer] $thrownTypeKind] != -1]} {
				::logiscope::addViolation $node
			}
		}
	}
	return 1
}
