Skip to content

[clang][ThreadSafety] Improve errors for trylock functions #97333

Open
@dmcardle

Description

@dmcardle

Originally, I merged the half-baked #95290, but reverted it in #97293.

Based on feedback, I plan to make the following changes before relanding:

  • Rather than locking down trylock function return types to a fixed set of types, require that they are contextually convertible to bool. This allows for smart pointers.
  • Restrict success expressions to integer/bool literals.
  • Explicitly handle each allowed success expr type in getMutexIDs() rather than using EvaluateAsBooleanCondition().
  • Potentially add a flag that disables any new errors/warnings to enable codebases to gradually fix their annotations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions