Files
bison/tests
Akim Demaille 3abad26a2d %merge: associate it to its first definition, not the latest
Currently each time we meet %merge we record this location as the
defining location (and symbol).  Instead, record the first definition.

In the generated code we go from

    yy0->A = merge (*yy0, *yy1);

to

    yy0->S = merge (*yy0, *yy1);

where S was indeed the first symbol, and in the diagnostics we go from

    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
       31 | sym3: %merge<merge> { $$ = 0; } ;
          |             ^~~~~~~
    glr-regr18.y:30.18-24: note: previous declaration
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~

to

    glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
       30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~
    glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type1>
       31 | sym3: %merge<merge> { $$ = 0; } ;
          |             ^~~~~~~
    glr-regr18.y:29.18-24: note: previous declaration
       29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
          |                  ^~~~~~~

where both duplicates are reported against definition 1, rather than
using definition 1 as a reference when diagnosing about definition 2,
and then 2 as a reference for 3.

* src/reader.c (record_merge_function_type): Keep the first definition.
* tests/glr-regression.at: Adjust.
2021-01-23 15:02:49 +01:00
..
2019-02-21 06:46:07 +01:00
2020-01-10 19:16:23 +01:00
2021-01-23 10:43:25 +01:00
2020-08-30 10:05:18 +02:00
2020-01-10 19:16:23 +01:00
2020-08-08 07:53:33 +02:00
2020-06-28 09:49:00 +02:00
2020-05-02 09:27:16 +02:00
2020-01-10 19:16:23 +01:00
2020-05-21 20:14:59 +02:00
2020-01-10 19:16:23 +01:00
2020-04-13 16:49:54 +02:00
2020-01-10 19:16:23 +01:00
2020-05-22 07:52:27 +02:00
2019-11-03 10:32:22 +01:00