Finding noexcept

Hello everyone, I'm relatively new to the IDE and I am wondering whether there is a tool which can automatically tell if a function should be marked noexcept, I tried finding an answer online but I got nothing.

0
1 comment

I've found CLion already does this for me, at least for move constructors and move assignment operators. To test, you could just enter something like (untested):

struct C {
    C(C&& c);  // IDE should warn you this should be noexcept!
};

I'm used to coding with exceptions disabled etc so I'm not totally clear on how/when/why to use noexcept, but I have started using it when advised for if I ever do want to enable exceptions one day!

I think it's the Clang-tidy inspection that provides this warning.

 

0

Please sign in to leave a comment.