[flang] Complement one-to-one association check of bind name and entity name
authorPeixin-Qiao <qiaopeixin@huawei.com>
Tue, 14 Jun 2022 02:34:38 +0000 (10:34 +0800)
committerPeixin-Qiao <qiaopeixin@huawei.com>
Tue, 14 Jun 2022 02:34:38 +0000 (10:34 +0800)
commitdafd3cf8b1cc9dae0ae1fabc2fd1ad4379119d11
treeccaf82797154c570b4b06bad5310d02f8c46fe33
parentc6d8aa27c5fe6aca56c3f95ee61c35265d4fe6b9
[flang] Complement one-to-one association check of bind name and entity name

As Fortran 2018 C802 and C873, if bind name is specified, there can only
be only one entity. The check for common block is missed before. As
Fortran 2018 8.5.5 point 2, the bind name is one identifier, which is
unique. That is, one entity can not have multiple bind names. Also add
this check.

Reviewed By: klausler, Jean Perier

Differential Revision: https://reviews.llvm.org/D126961
flang/lib/Semantics/check-declarations.cpp
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/declarations03.f90 [new file with mode: 0644]