I supposedly found a bug in lalr1.cc skeleton with variant semantic type. When using mid-rule action { $<type>$ = value; } to return a value that will be used in further semantic actions, it appears that the value on stack becomes zero. Tested with Bison version 3.0.4.
Link to a minimal working example: https://pastebin.com/bwsTSWNU Link to StackOverflow question about it: https://stackoverflow.com/q/44811550/1538920 Best regards, Piotr Marcińczyk