Skip to content

Commit

Permalink
Fix spurious "Illegal use of symbol" bug.
Browse files Browse the repository at this point in the history
In create_var(), when overloading a symbol with the same name as a
module, do not check the private flag. You can always overload the
module name in this case.
  • Loading branch information
tskeith committed Nov 13, 2017
1 parent 2b20297 commit 180fa8a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tools/flang1/flang1exe/semant.c
Expand Up @@ -8879,7 +8879,6 @@ semant1(int rednum, SST *top)
}

} else {

sptr = create_var(sptr);
if (sem.kind_type_param) {
USEKINDP(sptr, 1);
Expand Down Expand Up @@ -12297,13 +12296,10 @@ create_var(int sym)
case ST_MODULE:
if (!DCLDG(sptr)) {
/*
* if the module is indirectly USEd (DCLD is not set) and it
* contained PRIVATE, it's ok to create a new symbol when used.
* if the module is indirectly USEd (DCLD is not set)
* it's ok to create a new symbol when used.
* Otherwise, the module name is stll visible.
*/
if (!PRIVATEG(sptr)) {
error(84, 3, gbl.lineno, SYMNAME(sptr), CNULL);
}
sptr = insert_sym(sptr);
}
break;
Expand Down

0 comments on commit 180fa8a

Please sign in to comment.