Is the behaviour of the compiler undefined, with Undefined Behaviour?

后端 未结 7 840
旧时难觅i
旧时难觅i 2021-01-03 08:48

When I answered this question, I wrote:

First, it is important to note that it is not only the behaviour of the user program that is undefined, it is

7条回答
  •  爱一瞬间的悲伤
    2021-01-03 09:25

    The C++ standard defines behavior for code, it doesn't define behavior for the compiler. As such, it doesn't really make sense to refer to undefined behavior of the compiler -- it was never well-defined to begin with. The only requirement is that it produces an implementation that conforms to the standard guidelines for the code. How it does this is an implementation detail.

提交回复
热议问题