On Wed, Aug 30, 2023 at 11:10:57AM +0200, FX Coudert via Gcc wrote:
> std::max and std::min, introduced by d99d73c77d1e and 2bad0eeb5573, are not 
> available because <algorithm> is not included. The following patch fixes the 
> build for me:
> 
> diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
> index 4f31a6dcf0f..1ca8c8839bf 100644
> --- a/gcc/analyzer/region-model.cc
> +++ b/gcc/analyzer/region-model.cc
> @@ -20,6 +20,7 @@ along with GCC; see the file COPYING3.  If not see
>    #include "config.h"
>  #define INCLUDE_MEMORY
> +#define INCLUDE_ALGORITHM
>  #include "system.h"
>  #include "coretypes.h"
>  #include "make-unique.h”
> 
> 
> Could you check it is what you intended, and push it?

Note, when using libstdc++ headers, <algorithm> isn't needed,
because <memory> includes bits/stl_algobase.h which defines std::min/max.

Another possibility is of course use MIN/MAX macros instead of std::min/max.

        Jakub

Reply via email to