Menu

#1565 Add noexcept to COM methods

Initial
open
nobody
5
2025-07-20
2025-07-15
mberchtold
No

This patch adds noexcept to COM interface methods. Typically these are methods with a HRESULT return type, which are not supposed to throw any exceptions. Adding noexcept reduces the number of unwind states.

Affected files:
win32/ScintillaWin.cxx
win32/SurfaceD2D.cxx

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2025-07-16

    I think I looked at this before and there were hassles with deriving noexcept from an interface defined as potentially throwing. As well as Microsoft's interface definitions, there are open source versions and even Microsoft isn't consistent.

     
  • Zufu Liu

    Zufu Liu - 2025-07-16
    • labels: --> Scintilla, win32
     
  • mberchtold

    mberchtold - 2025-07-19

    What specific issues did you encounter? Adding noexcept to COM methods which are final (all the ones in the patch) shouldn't cause any. Some of them (not all) are already annotated with the Microsoft specific declspec(nothrow) attribute.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.