https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86190
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- Further reduced: typedef unsigned long size_t; struct vector { typedef size_t size_type; size_type size(); }; bool func(vector vec, int var) { return vec.size() < static_cast<size_t>(var); } sc.cc: In function 'bool func(vector, int)': sc.cc:10:23: warning: conversion to 'vector::size_type {aka long unsigned int}' from 'int' may change the sign of the result [-Wsign-conversion] return vec.size() < static_cast<size_t>(var); ^~~~~~~~~~~~~~~~~~~~~~~~