Skip to content

[clang-tidy] modernize-min-max-use-initializer-list #91982

Closed
@VReichelt

Description

@VReichelt

Running the recently introduced clang-tidy check modernize-min-max-use-initializer-list on the following valid code snippet triggers an assertion:

clang-tidy: /LLVM/llvm-project/llvm/include/llvm/Support/Casting.h:706: auto llvm::cast_if_present(Y*) [with X = clang::Expr; Y = const clang::Stmt]: Assertion `isa<X>(Val) && "cast_if_present<Ty>() argument of incompatible type!"' failed.
#include <algorithm>

int x();
int y();
int z();

int foo()
{
  return std::max(x(), std::max(y(), z()));
}

Stacktrace attached
Crash.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions