public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "Dr. Jürgen Sauermann" <mail@juergen-sauermann.de>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11
Date: Fri, 3 Dec 2021 20:12:19 +0000	[thread overview]
Message-ID: <CAH6eHdR=VpNnVZ_VvLGVtgytpYovkbXVJhqKhk+8UsziDxBGpw@mail.gmail.com> (raw)
In-Reply-To: <21196ba1-2499-3ed9-a1c4-15f3ddd6a5ab@juergen-sauermann.de>

On Fri, 3 Dec 2021, 18:58 Dr. Jürgen Sauermann, <mail@juergen-sauermann.de>
wrote:

> Hi,
>
> not sure if this matters or how int can be fixed, but today I observed
> the following:
>
> Your web page says that "Static assertions" are supported by GCC since
> version 4.3.
>
> Today I tried to use "Static assertions" on an  avr-g++ resp. avr-gcc
> which identifies
> itself as:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-g++ --version
> avr-g++ (GCC) 5.4.0
> Copyright (C) 2015 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.
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-gcc --version
> avr-gcc (GCC) 5.4.0
> Copyright (C) 2015 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.
>
> but it seems not to support static assertions.
>
> The "regular" g++ works:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | g++ -S -o /dev/null -x c++ -
> <stdin>:2:15: error: static assertion failed: error
>
> while the avr-g++ fails:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | avr-g++ -S -o /dev/null -x c++
> -
> <stdin>:2:14: error: expected constructor, destructor, or type
> conversion before ‘(’ token
>
> Maybe this should be mentioned on the web page.
>


Static assertions are a C++11 feature, so you simply need to use -std=c++11
or -std=gnu++11

  reply	other threads:[~2021-12-03 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 18:58 Dr. Jürgen Sauermann
2021-12-03 20:12 ` Jonathan Wakely [this message]
2021-12-04 10:32   ` Dr. Jürgen Sauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdR=VpNnVZ_VvLGVtgytpYovkbXVJhqKhk+8UsziDxBGpw@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mail@juergen-sauermann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).