mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/25759 (Documentation not clear, attribute packed on class in C++)
2018-11-15 Sandra Loosemore <sandra@codesourcery.com> PR c++/25759 gcc/ * doc/extend.texi (Common Type Attributes): Make it explicit that attribute "packed" can apply to C++ classes. From-SVN: r266199
This commit is contained in:
parent
e6c6b1793b
commit
88c8c5a08c
|
|
@ -1,3 +1,9 @@
|
||||||
|
2018-11-15 Sandra Loosemore <sandra@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/25759
|
||||||
|
* doc/extend.texi (Common Type Attributes): Make it explicit
|
||||||
|
that attribute "packed" can apply to C++ classes.
|
||||||
|
|
||||||
2018-11-15 Martin Sebor <msebor@redhat.com>
|
2018-11-15 Martin Sebor <msebor@redhat.com>
|
||||||
|
|
||||||
PR c++/87541
|
PR c++/87541
|
||||||
|
|
|
||||||
|
|
@ -7314,17 +7314,16 @@ or @code{__pointer__} for the mode used to represent pointers.
|
||||||
|
|
||||||
@item packed
|
@item packed
|
||||||
@cindex @code{packed} type attribute
|
@cindex @code{packed} type attribute
|
||||||
This attribute, attached to @code{struct} or @code{union} type
|
This attribute, attached to @code{struct}, @code{union}, or C++ @code{class}
|
||||||
definition, specifies that each member (other than zero-width bit-fields)
|
type definition, specifies that each of its members (other than zero-width
|
||||||
of the structure or union is placed to minimize the memory required. When
|
bit-fields) is placed to minimize the memory required. This is equivalent
|
||||||
attached to an @code{enum} definition, it indicates that the smallest
|
to specifying the @code{packed} attribute on each of the members.
|
||||||
integral type should be used.
|
|
||||||
|
|
||||||
@opindex fshort-enums
|
@opindex fshort-enums
|
||||||
Specifying the @code{packed} attribute for @code{struct} and @code{union}
|
When attached to an @code{enum} definition, the @code{packed} attribute
|
||||||
types is equivalent to specifying the @code{packed} attribute on each
|
indicates that the smallest integral type should be used.
|
||||||
of the structure or union members. Specifying the @option{-fshort-enums}
|
Specifying the @option{-fshort-enums} flag on the command line
|
||||||
flag on the command line is equivalent to specifying the @code{packed}
|
is equivalent to specifying the @code{packed}
|
||||||
attribute on all @code{enum} definitions.
|
attribute on all @code{enum} definitions.
|
||||||
|
|
||||||
In the following example @code{struct my_packed_struct}'s members are
|
In the following example @code{struct my_packed_struct}'s members are
|
||||||
|
|
@ -7348,8 +7347,9 @@ struct __attribute__ ((__packed__)) my_packed_struct
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
You may only specify the @code{packed} attribute attribute on the definition
|
You may only specify the @code{packed} attribute attribute on the definition
|
||||||
of an @code{enum}, @code{struct} or @code{union}, not on a @code{typedef}
|
of an @code{enum}, @code{struct}, @code{union}, or @code{class},
|
||||||
that does not also define the enumerated type, structure or union.
|
not on a @code{typedef} that does not also define the enumerated type,
|
||||||
|
structure, union, or class.
|
||||||
|
|
||||||
@item scalar_storage_order ("@var{endianness}")
|
@item scalar_storage_order ("@var{endianness}")
|
||||||
@cindex @code{scalar_storage_order} type attribute
|
@cindex @code{scalar_storage_order} type attribute
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue