http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58338
Bug ID: 58338 Summary: Add noexcept to functions with a narrow contract Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Hello, the standard only requires a noexcept specifier on functions with a wide contract, to allow some debug implementations of functions with a narrow contract. However, it also explicitly gives permission to strengthen the exception specification of non-virtual functions. I believe libstdc++ should add noexcept whereever it can, since this is supposed to help with performance. Functions like vector::front seem like good candidates. I wouldn't mind if the debug version had a different exception specification, but that doesn't even seem necessary since libstdc++ aborts instead of throwing. https://groups.google.com/a/isocpp.org/d/msg/std-discussion/lkRyImxouC0/kZpWqI0MjXsJ