Classes

A class is a user-defined type.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 148C++98POD classes could not contain pointers to member,which are themselves POD (scalar) typesrestriction removed
CWG 383C++98copy assignment operators or destructors could beuser-declared in POD classes if they are not definednot allowed
CWG 1363C++11a class that has both trivial default constructors and non-trivial default constructors at the same time could be trivialit is non-trivial
CWG 1496C++11a class that only has constructors thatare all defined as deleted could be trivialit is non-trivial
CWG 1672C++11a class could be a standard-layout classif it has multiple empty base classesit is not a standard-layout class
CWG 1734C++11a trivially copyable class could not have non-trivialdeleted copy/move constructors/assignment operatorscan be trivial if deleted
CWG 1813C++11a class was never a standard-layout class if it has abase class that inherits a non-static data memberit can be a standard-layout class
CWG 1881C++11for a standard-layout class and its base classes,unnamed bit-fields might be declared in adifferent class declaring the data membersall non-static data membersand bit-fields need to be firstdeclared in the same class
CWG 1909C++98a member template could have the same name as its classprohibited
CWG 2120C++11the definition of M(X) in determining a standard-layout class did not consider the case ofa class whose first member is an arrayaddressed this case inthe definition of M(X)
CWG 2605C++98an implicit-lifetime class could have a user-provided destructorprohibited