https://bugs.llvm.org/show_bug.cgi?id=37843
Bug ID: 37843
Summary: clang++ accept an ill-formed code sample
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: zhong...@pku.org.cn
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
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
It seems that g++ is right, and clang++ shall also provide similar error
messages?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs