Skip to content
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

[SystemZ] No compile time error returned for vector double _Complex type #88399

Closed
bahareh-farhadi opened this issue Apr 11, 2024 · 3 comments · Fixed by #90467
Closed

[SystemZ] No compile time error returned for vector double _Complex type #88399

bahareh-farhadi opened this issue Apr 11, 2024 · 3 comments · Fixed by #90467
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@bahareh-farhadi
Copy link
Contributor

bahareh-farhadi commented Apr 11, 2024

The test expects a compile time error when a vector double _Complex variable is declared; however, no error is returned.
According to the supported vector data types listed in https://www.ibm.com/docs/en/zos/2.5.0?topic=support-vector-data-types vector double _Complex is not supported, so a compile time error is expected.

Test case:

$ cat t.c
 
double _Complex b;
 
int main()
{
    vector double _Complex a = {b};
}

Command to reproduce the actual behaviour:

$ clang -mvx -mzvector  t.c
$ echo $?
0

GCC returns a compile time error as expected:

$ gcc -mvx -mzvector t.c
t.c: In function ‘main’:
t.c:5:5: error: invalid vector type for attribute ‘vector_size’
    5 |     vector double _Complex a = {b};
      |     ^~~~~~
@github-actions github-actions bot added the clang Clang issues not falling into any other category label Apr 11, 2024
@bahareh-farhadi bahareh-farhadi changed the title [Clang] No compile time error returned for vector double _Complex type [SystemZ] No compile time error returned for vector double _Complex type Apr 11, 2024
@EugeneZelenko EugeneZelenko added clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' and removed clang Clang issues not falling into any other category labels Apr 11, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 11, 2024

@llvm/issue-subscribers-clang-driver

Author: None (bahareh-farhadi)

The test expects a compile time error when a `vector double _Complex` variable is declared; however, no error is returned. According to the supported vector data types listed in [https://www.ibm.com/docs/en/zos/2.5.0?topic=support-vector-data-types](https://www.ibm.com/docs/en/zos/2.5.0?topic=support-vector-data-types) `vector double _Complex` is not supported, so a compile time error is expected.

Test case:

$ cat t.c
 
double _Complex b;
 
int main()
{
    vector double _Complex a = {b};
}

Command to reproduce the actual behaviour:

$ clang -mvx -mzvector  t.c
$ echo $?
0

GCC returns a compile time error as expected:

$ gcc -mvx -mzvector t.c
t.c: In function ‘main’:
t.c:5:5: error: invalid vector type for attribute ‘vector_size’
    5 |     vector double _Complex a = {b};
      |     ^~~~~~

@uweigand
Copy link
Member

Confirmed. Note that this also happens for "vector float _Complex".

uweigand added a commit to uweigand/llvm-project that referenced this issue Apr 29, 2024
The AltiVec (POWER) and ZVector (IBM Z) language extensions do
not support using the "vector" keyword when the element type is
a complex type, but current code does not verify this.

Add a Sema check and diagnostic for this case.

Fixes: llvm#88399
uweigand added a commit to uweigand/llvm-project that referenced this issue Apr 30, 2024
The AltiVec (POWER) and ZVector (IBM Z) language extensions do
not support using the "vector" keyword when the element type is
a complex type, but current code does not verify this.

Add a Sema check and diagnostic for this case.

Fixes: llvm#88399
uweigand added a commit that referenced this issue Apr 30, 2024
…0467)

The AltiVec (POWER) and ZVector (IBM Z) language extensions do not
support using the "vector" keyword when the element type is a complex
type, but current code does not verify this.

Add a Sema check and diagnostic for this case.

Fixes: #88399
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Apr 30, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 30, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (bahareh-farhadi)

The test expects a compile time error when a `vector double _Complex` variable is declared; however, no error is returned. According to the supported vector data types listed in [https://www.ibm.com/docs/en/zos/2.5.0?topic=support-vector-data-types](https://www.ibm.com/docs/en/zos/2.5.0?topic=support-vector-data-types) `vector double _Complex` is not supported, so a compile time error is expected.

Test case:

$ cat t.c
 
double _Complex b;
 
int main()
{
    vector double _Complex a = {b};
}

Command to reproduce the actual behaviour:

$ clang -mvx -mzvector  t.c
$ echo $?
0

GCC returns a compile time error as expected:

$ gcc -mvx -mzvector t.c
t.c: In function ‘main’:
t.c:5:5: error: invalid vector type for attribute ‘vector_size’
    5 |     vector double _Complex a = {b};
      |     ^~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants