@@ -763,20 +763,20 @@ Expr<Type<TypeCategory::Integer, KIND>> FoldIntrinsicFunction(
763763 context, std::move (funcRef), &Scalar<T>::IEOR, Scalar<T>{});
764764 } else if (name == " ishft" ) {
765765 return FoldElementalIntrinsic<T, T, Int4>(context, std::move (funcRef),
766- ScalarFunc<T, T, Int4>([&]( const Scalar<T> &i,
767- const Scalar<Int4> &pos) -> Scalar<T> {
768- auto posVal{static_cast <int >(pos.ToInt64 ())};
769- if (posVal < -i.bits ) {
770- context.messages ().Say (
771- " SHIFT=%d count for ishft is less than %d" _err_en_US, posVal ,
772- -i.bits );
773- } else if (posVal > i.bits ) {
774- context.messages ().Say (
775- " SHIFT=%d count for ishft is greater than %d" _err_en_US, posVal ,
776- i.bits );
777- }
778- return i.ISHFT (posVal);
779- }));
766+ ScalarFunc<T, T, Int4>(
767+ [&]( const Scalar<T> &i, const Scalar<Int4> &pos) -> Scalar<T> {
768+ auto posVal{static_cast <int >(pos.ToInt64 ())};
769+ if (posVal < -i.bits ) {
770+ context.messages ().Say (
771+ " SHIFT=%d count for ishft is less than %d" _err_en_US,
772+ posVal, -i.bits );
773+ } else if (posVal > i.bits ) {
774+ context.messages ().Say (
775+ " SHIFT=%d count for ishft is greater than %d" _err_en_US,
776+ posVal, i.bits );
777+ }
778+ return i.ISHFT (posVal);
779+ }));
780780 } else if (name == " ishftc" ) {
781781 if (args.at (2 )) { // SIZE= is present
782782 return FoldElementalIntrinsic<T, T, Int4, Int4>(context,
@@ -940,16 +940,15 @@ Expr<Type<TypeCategory::Integer, KIND>> FoldIntrinsicFunction(
940940 }));
941941 } else if (name == " modulo" ) {
942942 return FoldElementalIntrinsic<T, T, T>(context, std::move (funcRef),
943- ScalarFuncWithContext<T, T, T>(
944- [](FoldingContext &context, const Scalar<T> &x,
945- const Scalar<T> &y) -> Scalar<T> {
946- auto result{x.MODULO (y)};
947- if (result.overflow ) {
948- context.messages ().Say (
949- " modulo() folding overflowed" _warn_en_US);
950- }
951- return result.value ;
952- }));
943+ ScalarFuncWithContext<T, T, T>([](FoldingContext &context,
944+ const Scalar<T> &x,
945+ const Scalar<T> &y) -> Scalar<T> {
946+ auto result{x.MODULO (y)};
947+ if (result.overflow ) {
948+ context.messages ().Say (" modulo() folding overflowed" _warn_en_US);
949+ }
950+ return result.value ;
951+ }));
953952 } else if (name == " not" ) {
954953 return FoldElementalIntrinsic<T, T>(
955954 context, std::move (funcRef), &Scalar<T>::NOT);
@@ -1062,16 +1061,15 @@ Expr<Type<TypeCategory::Integer, KIND>> FoldIntrinsicFunction(
10621061 }));
10631062 } else if (name == " sign" ) {
10641063 return FoldElementalIntrinsic<T, T, T>(context, std::move (funcRef),
1065- ScalarFunc<T, T, T>(
1066- [&context](const Scalar<T> &j, const Scalar<T> &k) -> Scalar<T> {
1067- typename Scalar<T>::ValueWithOverflow result{j.SIGN (k)};
1068- if (result.overflow ) {
1069- context.messages ().Say (
1070- " sign(integer(kind=%d)) folding overflowed" _warn_en_US,
1071- KIND);
1072- }
1073- return result.value ;
1074- }));
1064+ ScalarFunc<T, T, T>([&context](const Scalar<T> &j,
1065+ const Scalar<T> &k) -> Scalar<T> {
1066+ typename Scalar<T>::ValueWithOverflow result{j.SIGN (k)};
1067+ if (result.overflow ) {
1068+ context.messages ().Say (
1069+ " sign(integer(kind=%d)) folding overflowed" _warn_en_US, KIND);
1070+ }
1071+ return result.value ;
1072+ }));
10751073 } else if (name == " size" ) {
10761074 if (auto shape{GetContextFreeShape (context, args[0 ])}) {
10771075 if (auto &dimArg{args[1 ]}) { // DIM= is present, get one extent
0 commit comments