![](https://csdnimg.cn/release/download_crawler_static/748591/bg12.jpg)
c
ISO/IEC N2800=08-0310
during translation or program execution in a documented manner characteristic of the environment (with or
without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance
of a diagnostic message). Many erroneous program constructs do not engender undefined behavior; they are
required to be diagnosed. — end note ]
1.3.14 [defns.unspecified]
unspecified behavior
behavior, for a well-formed program construct and correct data, that depends on the implementation. The
implementation is not required to document which behavior occurs. [ Note: usually, the range of possible
behaviors is delineated by this International Standard. — end note ]
1.3.15 [defns.wel l. formed]
well -formed program
a C
++
program constructed according to the syntax rules, diagnosable semantic rules, and the One De finition
Rule (3.2).
1.4 Implementati on compliance [intro.compli ance]
1 The set of diagnosable rules consists of all syntactic and semantic rules in this International Standard except
for those rules containing an explicit notation that “no diagnostic is required” or which are described as
resulting in “undefined behavior.”
2 Although this International Standard states only requirements on C
++
implementations, those requirements
are often easier to understand if they are phrased as requirements on programs, parts of programs, or
execution of programs. Such requirements have the following meaning:
— If a program contains no violations of the rules in this International Standard, a conforming imple-
mentation shall, within its resource limits, accept and correctly execute
2
that program.
— If a program contains a violation of any diagnosable rule or an occurrence of a construct described in
this Standard as “conditionally-supported” when the implementation does not support that construct,
a conforming implementation shall issue at least one diagnostic message.
— If a program contains a violation of a rule for w hich no diagnostic is required, this International
Standard places no requirement on implementations with respect to that program.
3 For classes and class templates, the library Clauses specify partial definitions. Private members (Clause 11)
are not specified, but each implementation shall supply them to complete the definitions according to the
description in the library Clauses.
4 For functions, function templates, objects , and values, the library Clauses specify declarations. Implemen-
tations shall supply definitions consistent with the descriptions in the library Clauses.
5 The names defined in the library have namespace scope (7.3). A C
++
translation unit (2.1) obtains access
to these names by including the appropriate standard library header (16.2).
6 The templates, classes , functions, and objects in the library have external linkage (3.5). The implementation
provides definitions for standard library entities, as necessary, while combining translation units to form a
complete C
++
program (2.1).
7 Two kinds of implementations are defined: hosted and freestanding. For a hosted implementation, this
International Standard defines the set of available libraries. A freestanding implementation is one in which
2) “Correct execution” can include undefined behavior, depending on the data being processed; see 1.3 and 1.9.
§ 1.4 4