https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012
Steve Kargl <kargl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #11 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to GCC Commits from comment #10)
> The master branch has been updated by Harald Anlauf <[email protected]>:
>
> https://gcc.gnu.org/g:84ef4948609260266f365c63ce429476fd31262f
>
> commit r16-7604-g84ef4948609260266f365c63ce429476fd31262f
> Author: Gonzalo Silvalde Blanco <[email protected]>
> Date: Fri Feb 20 20:30:55 2026 +0100
>
> Fortran: Fix diagnostic for ambiguous pointer function assignment
> [PR80012]
>
> The error message for an ambiguous pointer function assignment contained
> a
> FIXME and an embedded newline that the diagnostics printer does not
> handle.
> Split the single gfc_error call into a gfc_error for the main diagnostic
> and an inform note for the F2008 explanation, wrapped in an
> auto_diagnostic_group.
>
> PR fortran/80012
>
> gcc/fortran/ChangeLog:
>
> * symbol.cc (gfc_add_procedure): Split error into gfc_error and
> inform using auto_diagnostic_group.
>
> gcc/testsuite/ChangeLog:
>
> * gfortran.dg/pr80012.f90: New test.
>
> Signed-off-by: Gonzalo Silvalde Blanco <[email protected]>
This is causing 300 or so regressions of FreeBSD.
% git revert 84ef4948609260266f
fixes the regression.
% gfcx --version pr96102.f90
GNU Fortran (GCC) 16.0.1 20260117 (experimental)
% gfcx -c pr96102.f90
pr96102.f90:14:15:
14 | integer :: n = 2 ! { dg-error "is host associated" }
| 1
......
17 | if ( n /= 0 ) stop 1 ! { dg-error "internal procedure of the
same name" }
| 2
Error: 'n' at (1) is host associated at (2) into a contained procedure with an
internal procedure of the same name
pr96102.f90:13:20:
13 | type(mytype) :: d = mytype (42) ! { dg-error "is host associated" }
| 1
......
18 | if ( d%i /= 0 ) stop 2 ! { dg-error "internal procedure of the
same name" }
| 2
Error: 'd' at (1) is host associated at (2) into a contained procedure with an
internal procedure of the same name
% gfcx --version pr96102.f90
GNU Fortran (GCC) 16.0.1 20260220 (experimental)
gfcx -c pr96102.f90
f951: internal compiler error: in set_diagnostic_buffer, at buffering.cc:50
0x2790d8b internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:787
0x9dd0bc fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostics/context.cc:1812
0x9dcdf7 diagnostics::context::set_diagnostic_buffer(diagnostics::buffer*)
../../gcc/gcc/diagnostics/buffering.cc:50
0xa33c32 gfc_error_opt
../../gcc/gcc/fortran/error.cc:792
0xa3500f gfc_error(char const*, ...)
../../gcc/gcc/fortran/error.cc:820
0xb0ca18 gfc_add_procedure(symbol_attribute*, procedure_type, char const*,
locus*)
../../gcc/gcc/fortran/symbol.cc:1892