Skip to content

False positive clang warning for -Wassign-enum #20574

@llvmbot

Description

@llvmbot
Bugzilla Link 20200
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@Weverything

Extended Description

Clang 3.5 is throwing a false positive warning for -Wassign-enum. I created a test case and ran:

typedef enum {RANDOM, IMMEDIATE, SEARCH} strategy_t;
int main() {
  strategy_t my_strategy = IMMEDIATE;
my_strategy = (my_strategy & ~(IMMEDIATE));

  my_strategy &= ~(IMMEDIATE);                                                                                  

  return 0;
}

The second

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyfalse-positiveWarning fires when it should not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions