This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/62295] New: Variable Lenth Ararys can't be passed to functions in c++


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

            Bug ID: 62295
           Summary: Variable Lenth Ararys can't be passed to functions in
                    c++
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cdkrot at yandex dot ru

Hello!
The https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html#Variable-Length
says that gcc accepts variable length arrays in c++.
But i found that passing VLA's to function doesn't work in c++.

For example compiling function with following prototype succeeds in c, but
fails in c++.

> int sum(int n, int mat[][n])

This is probably a documentation bug or c++ compiler error.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]