The classic GSG prohibition on exceptions has more to do with a lack of exception safety in their legacy code base than anything else. Promptly-crash-on-failure can be achieved by adopting a "don't catch exceptions" style, with significant advantages of not throwing away much of the strengths of RAII or needing the evil hack that is two-phase initialization.
Re:Misra C++:2023 Published
by shadowgovt on Sunday December 17, 2023 @04:40PM
(#38676725)
You can for all intents and purposes avoid two phase init with factory functions (which is how Go does it) and private constructors.
(To my memory though, Google didn't throw away the benefits of RAII without allowing exceptions... They discouraged complicated behavior in constructors and so the only thing a constructor could fail on was OME, which was supposed to crash anyway).
Re:Misra C++:2023 Published
by otabdeveloper4 on Monday December 18, 2023 @03:33AM
(#38680325)
All Google code is a huge antipattern and an example of enterprise coding gone insane.
Given that constraint, they conclude that the overhead of maintaining exception unwinding and the non-local control flow aren't worth it.