diff --git a/flang/lib/Semantics/check-case.cpp b/flang/lib/Semantics/check-case.cpp --- a/flang/lib/Semantics/check-case.cpp +++ b/flang/lib/Semantics/check-case.cpp @@ -94,7 +94,7 @@ return value; } else { context_.Say(expr.source, - "CASE value (%s) overflows type (%s) of SELECT CASE expression"_err_en_US, + "CASE value (%s) overflows type (%s) of SELECT CASE expression"_warn_en_US, folded.AsFortran(), caseExprType_.AsFortran()); hasErrors_ = true; return std::nullopt; diff --git a/flang/test/Semantics/case01.f90 b/flang/test/Semantics/case01.f90 --- a/flang/test/Semantics/case01.f90 +++ b/flang/test/Semantics/case01.f90 @@ -182,13 +182,13 @@ integer :: j select case(1_1) case (127) - !ERROR: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARN: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression case (128) - !ERROR: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression - !ERROR: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARN: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARN: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression case (129:130) - !ERROR: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression - !ERROR: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARN: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARN: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression case (-130:-129) case (-128) !ERROR: Must be a scalar value, but is a rank-1 array