Re: minimum required -std=c++NN?

Patrick Welche <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On Tue, Jun 25, 2024 at 01:38:38PM +0200, Christoph Badura wrote:
> On Fri, Jun 21, 2024 at 03:05:42PM -0400, Greg Troxel wrote:
> >   C++20 is new, but that's how it is.  As for that file vs all of gcc,
> >   what does gcc's build instructions say?  If they don't, they are
> >   buggy.
> 
> I've not found anything in the build instructions that mentions that file
> (or directory) specifically neither a mention of c++20.
> 
> The build instructions say that gcc 12 needs a c++11 compiler.
> 
> Apparently both gcc10 and clang 14 know enough about c++20 in c++11 mode
> to compile the file but warn about the c++20 constructs.

I think it matters that these particular constructs are attributes, as,
quoting from https://en.cppreference.com/w/cpp/language/attributes :

  Besides the standard attributes listed below, implementations
  may support arbitrary non-standard attributes with implementation-defined
  behavior. All attributes unknown to an implementation are ignored
  without causing an error.(since C++17)

So the warning is just saying "I don't recognize that attribute, but I
happen to know that with my c++20 hat on, I would".

(Even if the attribute is recognized, the compiler is also allowed to
do nothing about it.)


Cheers,

Patrick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.