Skip to content

[SR-2401] Macros with bitwise operations should be imported #45008

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

Open
belkadan opened this issue Aug 18, 2016 · 0 comments
Open

[SR-2401] Macros with bitwise operations should be imported #45008

belkadan opened this issue Aug 18, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c/c++ macros c interop Feature: Interoperability with C compiler The Swift compiler itself

Comments

@belkadan
Copy link
Contributor

Previous ID SR-2401
Radar rdar://problem/18706771
Original Reporter @belkadan
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, ClangImporter, Macros
Assignee None
Priority Medium

md5: bf817a076ddc93edd071b2f1d749c10d

relates to:

  • SR-2402 Clang importer should import nullary function-like macros
  • SR-2530 Import macros containing string concatenation

Issue Description:

#define AVAILABLE_VALUE         0x10000
#define NOT_AVAILABLE_VALUE     (AVAILABLE_VALUE | 1)

Swift can see AVAILABLE_VALUE, but not NOT_AVAILABLE_VALUE because it has bitwise operations in it. Ideally the compiler should assume the identifier refers to a previous macro and constant-fold this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c/c++ macros c interop Feature: Interoperability with C compiler The Swift compiler itself
Projects
None yet
Development

No branches or pull requests

2 participants