https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105400
--- Comment #2 from Laurent Pinchart <laurent.pinchart at ideasonboard dot com> --- Thank you Andrew for the very quick answer! The original code is available at https://git.libcamera.org/libcamera/libcamera.git/tree/src/libcamera/base/object.cpp (the process() function is Object::message(), and the func() function is Object::notifyThreadMove()), with the corresponding header in https://git.libcamera.org/libcamera/libcamera.git/tree/include/libcamera/base/object.h. I agree that gcc can't know that b->type() will return Type1, but is it right to assume that this code construct deserves a warning ? If so, what would be the right code construct from gcc's point of view to achieve the same without a warning ? We strive to have a build-free warning in the libcamera project.