-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to resolve array size #8967
Comments
@drhaozhong, thanks for the report. It turned out it is not a DPC++-specific error because it is reproduced on mainline LLVM, the reproducer is: https://godbolt.org/z/dYhq8En39. |
@drhaozhong other issues are also not DPC++-related. We address here only DPC++-specific issues because we develop DPC++ compiler in this fork. |
@drhaozhong may hope that DPC++ could solve these issues when the mainline LLVM won't. |
The code is as follows:
int n = 0, p[n * 0 + 1];
The error message is:
error: variable length array declaration not allowed at file scope
int n = 0, p[n * 0 + 1];
^ ~~~~~~~~~
1 error generated.
The size of p can be calculated, since n is zero.
GCC accepts the above code.
The text was updated successfully, but these errors were encountered: