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

missing error detection in support for variable alias attribute #7108

Closed
llvmbot opened this issue Mar 29, 2010 · 6 comments
Closed

missing error detection in support for variable alias attribute #7108

llvmbot opened this issue Mar 29, 2010 · 6 comments
Labels
accepts-invalid bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 29, 2010

Bugzilla Link 6736
Version 2.6
OS Linux
Reporter LLVM Bugzilla Contributor
CC @asl,@cychen2021

Extended Description

There is and attribute to specify variable to be alias of another variable

attribute ((alias ("variable2")));

This makes this variable alias to location variable2

It seems that the correctness of the symbol where the alias is created is not checked in clang:

attribute ((alias ("variable2 + 2")));

should cause a compiler error, but it passes, and creates a bogus reference to a variable named "variable2 + 2".

At least newlib seems to use this broken syntax(because gcc can actually do the calculation), which then goes thru configure check(because the error is not detected when compiling) but fails on actual linking, which causes newlib to not work when compiled with clang.

@asl
Copy link
Collaborator

asl commented Mar 29, 2010

As an alternative, we might try to accept this weirdness, btu do syntax checking and emit a gep

@lattner
Copy link
Collaborator

lattner commented Mar 29, 2010

That sounds scary to me, we should just require it to be an identifier. Doing anything more complex will be really fragile. Also, relying on it to "pop out to the assembler and just work" won't work with an integrated assembler.

@asl
Copy link
Collaborator

asl commented Mar 29, 2010

That sounds scary to me, we should just require it to be an identifier. Doing
anything more complex will be really fragile. Also, relying on it to "pop out
to the assembler and just work" won't work with an integrated assembler.
Yeah, so, we should just emit an error in this case.

@lattner
Copy link
Collaborator

lattner commented Mar 29, 2010

Sounds right to me.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Endilll Endilll added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang Clang issues not falling into any other category labels May 21, 2023
@Endilll
Copy link
Contributor

Endilll commented May 21, 2023

Fixed in Clang 3.4
https://godbolt.org/z/5f6Mqovr9

@Endilll Endilll closed this as completed May 21, 2023
@llvmbot
Copy link
Collaborator Author

llvmbot commented May 21, 2023

@llvm/issue-subscribers-clang-frontend

augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue Aug 24, 2023
[🌲] Muting llvm::None warning in Swift for now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts-invalid bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

4 participants