5 Feb
2026
5 Feb
'26
10:05 a.m.
Dear GiNaC developers, I noticed a strange bug, which only happens with some compiler versions. In some cases, nested lists collapse into a flat list. Consider the following program:
#include <iostream> #include "ginac/ginac.h"
using namespace GiNaC; int main(int argc, const char** argv) { std::cout << lst{lst{1}} << std::endl; return 0; }
I tested this with GCC 11.4.0 and clang 21.1.0. With those compilers, it correctly prints
{{1}}
But with clang 19.1.7, it instead yields
{1}
I tested some other cases and it seems that the issue occurs whenever a list has a single element which is also a list. Best regards Florian