clang++ intermittent failure/success on constexpr-heavy code
I stumbled upon a library, Sprout, that is an exercise in using constexpr. The library uses
-W -Werror for compilation.
I noticed that at least a test (FWIW, the algorithm test) is failing with
clang++ because the number of steps and/or the depth of
constexpr is larger than the compiler defaults. A warning resulting in an error. The problem is that when it fails it does so with a variable number of errors between compilation runs and it intermittently succeeds at times while I am not altering the defaults at all. I saw the failures with stock compiler on Mac and 11 on Linux. Also, I built the latest compiler from source, same.
I suspect that is a race of sorts but I am at a loss at how to progress towards diagnosing it. Moreover, any attempt at creating a test case (reducing a preprocessed translation unit) fails to show the intermittent success/failure, i.e., it fails more reliably (can't say if 100% but a large enough number of times).
Any ideas or suggestions on how to proceed with investigating this?