[Bug c++/86253] New: N3639 array of runtime bound
zhonghao at pku dot org.cn
gcc-bugzilla@gcc.gnu.org
Thu Jun 21 02:01:00 GMT 2018
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?
More information about the Gcc-bugs
mailing list