https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119215
--- Comment #16 from James K. Lowden <jklowden at gcc dot gnu.org> ---
Some of the ODR reports are absolutely spot on, and I'm working to correct
them. This one I'm not convinced:
cobol/cdf.cc:200:6: warning: type 'yysymbol_kind_t' violates the C++ One
Definition Rule [-Wodr]
200 | enum yysymbol_kind_t
| ^
cobol/parse.cc:119:6: note: an enum with different value name is defined in
another translation unit
119 | enum yysymbol_kind_t
| ^
This enum is not among those renamed by the Bison option:
%define api.prefix {ydf}
but ISTM it need not be. No uses of that symbol have external linkage. It
does not appear in the generated header file (so is not included in the rest of
the parsers, and is internal to the implementation files:
$ nm -C ../../build/gcc/cobol/{parse,cdf}.o | grep -E yysymbol_kind_t\|/build/
../../build/gcc/cobol/parse.o:
00000000000115c4 t yydestruct(char const*, yysymbol_kind_t, YYSTYPE*, YYLTYPE*)
0000000000005b98 t yysymbol_name(yysymbol_kind_t)
0000000000010c74 t yy_symbol_print(_IO_FILE*, yysymbol_kind_t, YYSTYPE const*,
YYLTYPE const*)
0000000000005d40 t yy_symbol_value_print(_IO_FILE*, yysymbol_kind_t, YYSTYPE
const*, YYLTYPE const*)
0000000000011214 t yy_syntax_error_arguments(yypcontext_t const*,
yysymbol_kind_t*, int)
0000000000010f50 t yypcontext_expected_tokens(yypcontext_t const*,
yysymbol_kind_t*, int)
../../build/gcc/cobol/cdf.o:
00000000000017f0 t yydestruct(char const*, yysymbol_kind_t, YDFSTYPE*,
YDFLTYPE*)
0000000000000520 t yysymbol_name(yysymbol_kind_t)
0000000000000ea4 t yy_symbol_print(_IO_FILE*, yysymbol_kind_t, YDFSTYPE const*,
YDFLTYPE const*)
00000000000006c8 t yy_symbol_value_print(_IO_FILE*, yysymbol_kind_t, YDFSTYPE
const*, YDFLTYPE const*)
0000000000001440 t yy_syntax_error_arguments(yypcontext_t const*,
yysymbol_kind_t*, int)
000000000000117c t yypcontext_expected_tokens(yypcontext_t const*,
yysymbol_kind_t*, int)
If the report is correct IMO it would need to be reported as a Bison bug,
because the API renaming feature is supposed to allow two parsers to be used in
the same program. What am I missing?