[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 13:35:22 PDT 2024


jyu2-git wrote:

> It fails with
> 
> ```
> diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
> index 53d89ce2fa3e..1a4442f38f6d 100644
> --- a/clang/lib/Parse/ParseOpenMP.cpp
> +++ b/clang/lib/Parse/ParseOpenMP.cpp
> @@ -4326,6 +4326,7 @@ static OpenMPMapClauseKind isMapType(Parser &P) {
>    OpenMPMapClauseKind MapType =
>        static_cast<OpenMPMapClauseKind>(getOpenMPSimpleClauseType(
>            OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
> +  assert((int)MapType < 6);
>    return MapType;
>  }
> ```

So if I MapType is 6 and up it will assert?  Should I check 
if (MapType >= 6)
  MapType = OMPC_MAP_unknown
Thanks.



https://github.com/llvm/llvm-project/pull/90935


More information about the cfe-commits mailing list