Hacker News new | past | comments | ask | show | jobs | submit
No, UB is allowed special powers for compiler and standard library implementors, which is what Herb Sutter means with internal behaviour.

Meaning MSVC is aware of these cases, so the compiler has special cases for it.

That's my point - GSL is NOT MSVC only, it's a general purpose library and NOT a standard library implementation of a toolchain so any compiler is expected to be able to compile it (it also explicitly targets clang & gcc).
loading story #49158926
GSL is not the standard library nor an internal runtime library. Its GitHub page claims that it supports a variety of compilers:

> The GSL officially supports recent major versions of Visual Studio with both MSVC and LLVM, GCC, Clang, and XCode with Apple-Clang

loading story #49158922
Clang is a target for the GSL though. How can MSVC's special powers prevent this from being exploitable UB in Clang/LLVM?

This code boils down to static_cast<int>(some_double); so nothing fancy is going on here

loading story #49160232