Re: [PATCH] Bug 123375 - Fortran ICE in insert_bbt while building crest package since r16-2189
Jerry D <[email protected]>
| Newsgroups | gmane.comp.gcc.patches,gmane.comp.gcc.fortran |
|---|---|
| Message-ID | <[email protected]> |
On 1/18/26 4:50 PM, Jerry D wrote:
> On 1/18/26 4:38 PM, Steve Kargl wrote:
>> On Sun, Jan 18, 2026 at 03:44:55PM -0800, Jerry D wrote:
>>> On 1/18/26 1:56 PM, Harald Anlauf wrote:
>>> --- snip ---
>>>> Hi Jerry,
>>>>
>>>> technically speaking, the following error may confuse users as it
>>>> is a little misleading:
>>>
>>> How about this?
>>>
>>> $ gfc z1.f90
>>> z1.f90:7:17:
>>>
>>> 7 | import c_int, c_char
>>> | 1
>>> Error: ‘c_int’ at (1) is already available and cannot be imported.
>>>
>>
>> Simply remove "already" in from my original patch.
>>
>> + gfc_error ("import-name %qs at %C is in the "
>> + "local scope", name);
>>
>
> That works for me, I will make it so.
>
> Jerry
Committed
commit 8d1a6a84b158a6d825fb3d2dcbba8e02cce990fe (HEAD -> master, origin/master,
origin/HEAD)
Author: Steven G. Kargl <[email protected]>
Date: Sat Jan 17 18:30:44 2026 -0800
Fortran: Fix ICE on invalid code
This patch tests whether a symbol imported into an interface
is already available in local scope.
PR fortran/123375
gcc/fortran/ChangeLog:
* decl.cc (gfc_match_import): Check that imported entity within
a interface is not from local scope.
gcc/testsuite/ChangeLog:
* gfortran.dg/import.f90: Run code testing for a warning that
is now an error.
* gfortran.dg/pr123375.f90: New test.