This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86253] New: N3639 array of runtime bound
- From: "zhonghao at pku dot org.cn" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jun 2018 02:01:17 +0000
- Subject: [Bug c++/86253] New: N3639 array of runtime bound
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86253
Bug ID: 86253
Summary: N3639 array of runtime bound
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zhonghao at pku dot org.cn
Target Milestone: ---
The code is as follow:
int main(int argc, char** argv)
{
int x[1][argc];
[&x](int i)
{
x[0][i] = 0;
}(5);
return 0;
}
clang++ accepts the code, but g++ produces error messages:
capture of variably-modified type ‘int [1][argc]’ that is not an N3639 array of
runtime bound
because the array element type ‘int [argc]’ has variable size
I thought that this is a bug in clang, and reported it to
https://bugs.llvm.org/show_bug.cgi?id=37843
However, Richard Smith told me that clang++ can produce this message, since
clang++ has a feature that GCC's extension lacks. Does gcc have plan to
implement that feature?