Bug in <complex> header in trunk from malformed "requires" statement, causes compilation errors if included

Gavin Ray ray.gavin97@gmail.com
Fri Nov 18 18:59:13 GMT 2022


Hello all,

Hit a very confusing bug this morning. I'm using Clang with GCC
upstream libstdc++ from jwakely's repo.
The following program fails to compile:

#include <complex>
int main() { return 0; }

It appears there was an initial commit which added "requires" clauses,
and then a fixup commit later:
- libstdc++: Fix up <complex> for extended floating point types
[PR107649] · gcc-mirror/gcc@0e2c551 (github.com)

But there seems to be one last malformed "requires" statement in trunk:
https://github.com/gcc-mirror/gcc/blob/59cc4da605e5cb8e31e9f1d54ef2b5ba47fc8f88/libstdc%2B%2B-v3/include/std/complex#L2531

(Big thanks to Luke D'Alessandro for figuring this all out)
Thought I'd let you folks know.

Thank you!


More information about the Libstdc++ mailing list