9
Declarations
[dcl.dcl]
9.2
Specifiers
[dcl.spec]
9.2.9
Type specifiers
[dcl.type]
9.2.9.1
General
[dcl.type.general]
1
#
The type-specifiers are
type-specifier
:
simple-type-specifier
elaborated-type-specifier
typename-specifier
cv-qualifier
type-specifier-seq
:
type-specifier
attribute-specifier-seq
o
p
t
type-specifier
type-specifier-seq
defining-type-specifier
:
type-specifier
class-specifier
enum-specifier
defining-type-specifier-seq
:
defining-type-specifier
attribute-specifier-seq
o
p
t
defining-type-specifier
defining-type-specifier-seq
The optional
attribute-specifier-seq
in a
type-specifier-seq
or a
defining-type-specifier-seq
appertains to the type denoted by the preceding
type-specifier
s
or
defining-type-specifier
s
(
[dcl.
meaning]
)
.
The
attribute-specifier-seq
affects the type only for the declaration it appears in, not other declarations involving the same type
.
2
#
As a general rule, at most one
defining-type-specifier
is allowed in the complete
decl-specifier-seq
of a
declaration
or in a
defining-type-specifier-seq
, and at most one
type-specifier
is allowed in a
type-specifier-seq
.
The only exceptions to this rule are the following:
(2.1)
const
can be combined with any type specifier except itself
.
(2.2)
volatile
can be combined with any type specifier except itself
.
(2.3)
signed
or
unsigned
can be combined with
char
,
long
,
short
, or
int
.
(2.4)
short
or
long
can be combined with
int
.
(2.5)
long
can be combined with
double
.
(2.6)
long
can be combined with
long
.
3
#
Except in a declaration of a constructor, destructor, or conversion function, at least one
defining-type-specifier
that is not a
cv-qualifier
shall appear in a complete
type-specifier-seq
or a complete
decl-specifier-seq
.
78
4
#
[
Note
1
:
enum-specifier
s
,
class-specifier
s
, and
typename-specifier
s
are discussed in
[dcl.
enum]
,
[class]
, and
[temp.
res]
, respectively
.
The remaining
type-specifier
s
are discussed in the rest of
[dcl.
type]
.
—
end note
]
78)
78)
There is no special provision for a
decl-specifier-seq
that lacks a
type-specifier
or that has a
type-specifier
that only specifies
cv-qualifier
s
.
The “implicit int” rule of C is no longer supported
.