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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-10-14
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
While creating a test for a fix for this, I came across the following
diagnostic issued by grokdeclarator in cp/decl.c, showing that some invalid new
expressions are already being diagnosed.  (The ‘type name’ is wrong because the
array doesn't have a name, and is the result of the function setting the NAME
variable to "type name" when it's null.)

$ cat a.cpp && g++ -c a.cpp
void foo (void)
{
    new int [4][__SIZE_MAX__];
}
a.cpp: In function ‘void foo()’:
a.cpp:3:29: error: size of array ‘type name’ is too large
     new int [4][__SIZE_MAX__];
                             ^

Reply via email to