Building root with standard set to C++20 results in compilation errors on Linux

On the issue of those warnings about “The C++ standard in this build does not match ROOT configuration (201709L)”, I went digging into the root code and it looks like it’s coming from config/RConfigure.in :

#define ROOT__cplusplus @__cplusplus@
#if defined(__cplusplus) && (__cplusplus != ROOT__cplusplus)
# if defined(_MSC_VER)
#  pragma message("The C++ standard in this build does not match ROOT configuration (@__cplusplus@); this might cause unexpected issues. And please make sure you are using the -Zc:__cplusplus compilation flag")
# else
#  warning "The C++ standard in this build does not match ROOT configuration (@__cplusplus@); this might cause unexpected issues"
# endif
#endif

I don’t know enough about .in files but I suspect that this RConfigure.in is used to generate the RConfigure.h which is one of header files that is associated with this warning. Based on the code above, that warning is issued when __cplusplus is not equal to ROOT__cplusplus, where ROOT__cplusplus is set to @__cplusplus@ (not quite sure what is the difference between __cplusplus and @__cplusplus@). Unfortunately I couldn’t quite figure out how to modify the code above so that the warning message would print out what the __cplusplus value is, in addition to the ROOT__cplusplus value it printed, so that I can see how they differed.

But I was curious given my compiler, what the __cplusplus value is and so wrote this simple C++ code that prints it out:

int main() {

    std::cout << "__cplusplus is " << __cplusplus << std::endl;
    return 0;
}

and built it and ran it:

$ g++ --version
g++ (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ -std=c++2a print_cpp.cpp
$ ./a.out
__cplusplus is 201709

So when using the same compiler used to build root, the __cplusplus has a value of 201709. The warning message coming from that root code notes, “does not match ROOT configuration (201709L)”. The only difference here I see is the “L” at the end of this “ROOT configuration” value.

I don’t really understand the motive of this check in RConfigure.in, but it might be the case that something buggy is going on in that code. I’ve exhausted everything on my end on why that warning is appearing on my build of root.