[committed] Fix for multiple anonymous structures conflict with -fdec-structure
Fritz Reese
fritzoreese@gmail.com
Tue Aug 23 19:41:00 GMT 2016
Found another silly typo in my structure/union patch.
With anonymous nested structures, as with unions and maps (which are
inherently anonymous), a static counter is used to give each type
definition a unique name. Due to a typo the counter for anonymous
structures was not static, therefore was simply zero for each
invocation of decl.c (gfc_match_structure_decl). Thus only one
anonymous structure declaration could be used per program, as multiple
anonymous structure definitions would be given the same name, causing
the compiler to complain about conflicting type definitions.
Committed the attached as obvious as r239709 - includes testcase
exhibiting the regression.
---
Fritz Reese
2016-08-23 Fritz Reese <fritzoreese@gmail.com>
gcc/fortran/
* decl.c (gfc_match_structure_decl): Make gfc_structure_id static.
gcc/testsuite/gfortran.dg/
* dec_structure_12.f90: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: anonymous_structs.patch
Type: text/x-patch
Size: 1122 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160823/8a93b4c4/attachment.bin>
More information about the Fortran
mailing list