Bug 489801 - Incorrect definition of __is_trivial()
Summary: Incorrect definition of __is_trivial()
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-other (show other bugs)
Version: 8.8.1   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 18:34 EDT by Ben Dow CLA
Modified: 2020-09-04 15:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Dow CLA 2016-03-16 18:34:28 EDT
The C++11 standard, section 3.9 states:

Scalar types, trivial class types (Clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called trivial
types.

The commit at
http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=3b7da721b60c53f8f3e5baedeb41542f9d28d0d8
in the applyUnaryTypeIdOperator() method contains the code:

case op_is_trivial:
	return type instanceof ICPPClassType &&
		TypeTraits.isTrivial((ICPPClassType) type, point) ? 1 : 0;

It should also return true for scalar types and arrays of trivial types.