Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343676

Summary: false positive when break is part of an if/else block
Product: [Tools] CDT Reporter: Matt Hargett <matt>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Matt Hargett CLA 2011-04-22 20:16:15 EDT
Build Identifier: 201104150807

When a switch has a case, and the case has a break inside of a branching statement, the aforementioned warning gives a false positive: "No break at the end of this case"

Reproducible: Always

Steps to Reproduce:
code like this:
switch(type) {
			case ELEM_TYPE_ACCEPT:
				if (http_pipeline_base_request0->accept_rewrite || policyAcceptModified)
					continue;
				else
					break;
}
}
Comment 1 Elena Laskavaia CLA 2011-04-24 15:02:50 EDT
fixed 
(rewrote checker because current implementation was very complex and was not supporting complex structures, it was trying to use ast visitor which would not work for such checker)