[flang] address comments

Original-commit: flang-compiler/f18@ccbb1a2036
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2019-02-04 10:39:41 -08:00
parent fef7fcd45f
commit 7f7c44f425
2 changed files with 21 additions and 1 deletions

View File

@ -3008,7 +3008,7 @@ Symbol *DeclarationVisitor::DeclareLocalEntity(const parser::Name &name) {
ApplyImplicitRules(*prev);
implicit = true;
}
if (!ConvertToObjectEntity(*prev)) {
if (!ConvertToObjectEntity(*prev) || prev->attrs().test(Attr::PARAMETER)) {
Say2(name, "Locality attribute not allowed on '%s'"_err_en_US, *prev,
"Declaration of '%s'"_en_US);
return nullptr;
@ -3329,6 +3329,7 @@ void ConstructVisitor::Post(const parser::ConcurrentControl &x) {
if (details->IsArray()) {
Say2(name, "Index variable '%s' is not scalar"_err_en_US, *prev,
"Declaration of '%s'"_en_US);
return;
}
}
}

View File

@ -100,3 +100,22 @@ subroutine s8
local_init(k)
end do
end
subroutine s9
external bad1
real, parameter :: bad2
x = cos(0.)
do concurrent(i=1:2) &
!ERROR: Locality attribute not allowed on 'bad1'
local(bad1) &
!ERROR: Locality attribute not allowed on 'bad2'
local(bad2) &
!ERROR: Locality attribute not allowed on 'bad3'
local(bad3) &
!ERROR: Locality attribute not allowed on 'cos'
local(cos)
end do
contains
subroutine bad3
end
end