configure adds -std=gnu++11 to CXX variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

This is with autoconf 2.72 and GCC 9.4.0.

I try to configure a project with

./configure 'CXX=c++ -std=c++2a'

but the configure seems to dislike that because it outputs

checking whether the compiler supports GNU C++... yes
checking whether c++ -std=c++2a accepts -g... yes
checking for c++ -std=c++2a option to enable C++11 features... -std=gnu++11
checking dependency style of c++ -std=c++2a -std=gnu++11... gcc3

So it decides to add -std=gnu++11.

In the log file I notice

configure:5593: checking for c++ -std=c++2a option to enable C++11 features
configure:5608: c++ -std=c++2a  -c   conftest.cpp >&5
conftest.cpp: In function 'int main(int, char**)':
conftest.cpp:199:22: error: invalid conversion from 'const char8_t*' to
'const char*' [-fpermissive]
  199 |   char const *utf8 = u8"UTF-8 string \u2500";
      |                      ^~~~~~~~~~~~~~~~~~~~~~~
      |                      |
      |                      const char8_t*
configure:5608: $? = 1

I'm not sure I understand what configure/autoconf is trying to achieve
here. Why pushing me to support c++11 features?

And it's my understanding that char8_t was introduced in c++20 and that
line 199 above therefore is invalid in c++20, so IIUC I'm forced to use a
compiler that supports code that is invalid in c++20. Is there a way to get
around this?

Thanks,
Peter



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux