On 2020-07-24 16:31, Zack Weinberg wrote:
checking for g++ option to enable C++11 features... none needed
takes on the order of 10 seconds for some developers. And that is for
one loop, since "none needed"; good luck if you need more than none.
I suspect that this is because the test program for C++11 includes a
bunch of large and complicated C++ standard library headers. To
confirm that possibility, could you please ask someone who sees
"checking for g++ option to enable C++11 features ... none needed"
take 10 seconds to compile the appended test program with `g++ -O2 -g
-c` and report how long it takes. (It takes ~3s on my computer, which
is already too long IMHO, but if it doesn't take any longer than that
for them, something else must be wrong as well.)
Yeah, this takes about 6-7 seconds. Tried different versions of g++ (7,
8, 9, 10) without much difference.
Btw., clang issues a warning for that test program:
test.cc:113:25: warning: empty parentheses interpreted as a function
declaration [-Wvexing-parse]
cxx11test::delegate d2();
^~
test.cc:113:25: note: remove parentheses to declare a variable
cxx11test::delegate d2();
^~
1 warning generated.
I don't know whether that's something that should be cleaned up, or
whether it's part of what's being tested.