Skip to content

Fix VectorHashBiTable's copy constructor in the vendored OpenFst - #29

Closed
mmokrejs wants to merge 1 commit into
CartwrightLab:mainfrom
mmokrejs:fix/openfst-bi-table-copy-constructor
Closed

mmokrejs wants to merge 1 commit into
CartwrightLab:mainfrom
mmokrejs:fix/openfst-bi-table-copy-constructor

Conversation

@mmokrejs

Copy link
Copy Markdown

VectorHashBiTable's copy constructor in contrib/fstlib/fst/bi-table.h initialises selector_ from table.s_, a member that does not exist. Compilers that check member access in uninstantiated templates reject the header, so coati does not build with GCC 16 or Clang 19 -- src/lib/align_fst.cc and src/lib/mutation_fst.cc stop with

contrib/fstlib/fst/bi-table.h:333:25: error: 'const class fst::VectorHashBiTable<I, T, S, FP, H, HS>' has no member named 's_'; did you mean 'h_'? [-Wtemplate-body]

OpenFst 1.8.4 has the same one-line fix, selector_(table.selector_); this backports it to the vendored 1.8.3. The copy constructor is now identical to 1.8.4's.

Test

  • GCC 16.2.0 (the gcc:16 Docker image), every translation unit checked with -fsyntax-only: main fails 2 of 35 (the two above); this branch, configured with -Dtest=true, compiles all 52.
  • Clang 19.1.7, ninja -k 0: main fails the same two and nothing else; this branch builds 46/46.
  • GCC 14.2: this branch builds and meson test passes 49/49.
  • A program that copies a VectorHashBiTable fails to compile against main with every one of these compilers, GCC 14 included, and compiles and runs correctly against this branch.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

contrib/fstlib/fst/bi-table.h initialised selector_ from table.s_, a
member that does not exist. Compilers that check member access in
uninstantiated templates reject it -- GCC 16 and Clang 19 stop on
src/lib/align_fst.cc and src/lib/mutation_fst.cc with

  fst/bi-table.h:333:25: error: 'const class
  fst::VectorHashBiTable<I, T, S, FP, H, HS>' has no member named 's_'

and every compiler rejects it once the copy constructor is used.
OpenFst 1.8.4 has the same one-line fix, selector_(table.selector_);
this backports it to the vendored 1.8.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reedacartwright

Copy link
Copy Markdown
Contributor

The vendored OpenFST library has been updated to 1.8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants