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

            Bug ID: 68265
           Summary: Arbitrary syntactic nonsense silently accepted after
                    'int (*){}' until the next close brace
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zackw at panix dot com
  Target Milestone: ---

(From https://stackoverflow.com/questions/33614455/ :)

The C++ compiler fails to diagnose ill-formed constructs such as

  int main()
  {
      int (*) {}
         any amount of syntactic nonsense
         on multiple lines, with *punctuation* and ++operators++ even...
         will be silently discarded
         until the next close brace
  }

With -pedantic -std=c++98 you do get "warning: extended initializer lists only
available with -std=c++11 or -std=gnu++11", but with -std=c++11, not a peep.

If any one (or more) of the tokens 'int ( * ) { }' are removed, you do get an
error.  Also, the C compiler does not have the same bug.

Reply via email to