https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103131

            Bug ID: 103131
           Summary: -Wpedantic doesn't warn about extra semicolons anymore
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mail at milianw dot de
  Target Milestone: ---

Starting with GCC 11, we don't see any warnings about extra semicolons anymore:

```
struct foo{};;
```

Compile:

```
g++ -Wall -Wpedantic -Wextra test.cpp -o test.o
```

No warning is emitted with gcc version 11.0 and up. gcc 9 and below on the
other hand used to complain:

```
<source>:1:15: warning: extra ';' [-Wpedantic]
    1 | struct foo {};;
      |               ^
ASM generation compiler returned: 0
<source>:1:15: warning: extra ';' [-Wpedantic]
    1 | struct foo {};;
      |               ^
```

See also this godbolt link for a live demo:
https://godbolt.org/z/fKGqf8ExP

Reply via email to