Skip to content

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

Open
@belkadan

Description

@belkadan
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.c interopFeature: Interoperability with Cc/c++ macroscompilerThe Swift compiler itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions