Bug 575646 - Codan ignores [[noreturn]] attibute
Summary: Codan ignores [[noreturn]] attibute
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 10.3.0   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-26 08:28 EDT by David Crocker CLA
Modified: 2021-08-26 08:28 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Crocker CLA 2021-08-26 08:28:24 EDT
Code analysis ignored the [[noreturn]] attribute. For example for the following code in C++ 17 mode:

extern void [[noreturn]] quit();

inline int test(int i)
{
	if (i != 0)
	{
		return i;
	}
	quit();
}

Codan reports "No return, in function returning non-void".

The same is reported if [[noreturn]] is replaced by the gcc-specific __attribute__((noreturn)). See also related bug 316076.