What is the C++ compiler required to do with ill-formed programs according to the Standard?

后端 未结 4 1638
无人共我
无人共我 2020-11-28 12:02

C++03 Standard defines well-formed program (1.3.14 [defns.well.formed]) as

a C++ program constructed according to the syntax rules, diagnosab

4条回答
  •  一生所求
    2020-11-28 12:29

    The only relevant quote I could find says that an implementation is required to diagnose an ill-formed program, but it can finish compiling it:

    1.4 Implementation compliance [intro.compliance]

    8) A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any well-formed program. Implementations are required to diagnose programs that use such extensions that are ill-formed according to this International Standard. Having done so, however, they can compile and execute such programs.

提交回复
热议问题