[flang] Fix SELECTED_CHAR_KIND('DEFAULT') folding issue
authorJean Perier <jperier@nvidia.com>
Fri, 23 Aug 2019 10:36:29 +0000 (03:36 -0700)
committerJean Perier <jperier@nvidia.com>
Fri, 23 Aug 2019 10:36:29 +0000 (03:36 -0700)
commit8c4d2e8763976a0ee0a1afd7bfd05985c190a74c
tree6de1b544a5a2c7d2d249784299ede051ade9fee5
parent61814dbf1d2baa16b8cb2920fe79e6015f16a7e5
[flang] Fix SELECTED_CHAR_KIND('DEFAULT') folding issue
Fix issue flang-compiler/f18#676
The issue was that the 'DEFAULT' case was handled
directly in fold.cc which did not lowercase/trim trailing
space of the argument befaore comparing to "default".

Modify the `Selected_char_kind` function to accept the default
char kind as argument and to return it if the processed argument
matches "default".

Original-commit: flang-compiler/f18@14222ae9148af4f99f59e6f9f0b928baa2da0b10
Reviewed-on: https://github.com/flang-compiler/f18/pull/679
flang/lib/evaluate/fold.cc
flang/lib/evaluate/type.cc
flang/lib/evaluate/type.h
flang/test/evaluate/folding05.f90