Skip to content

ICE with statement expression + builtin: Assertion failed: (!isValueDependent() && "Expression evaluator can't be called on a dependent expression.") #153082

@comex

Description

@comex

As of 1a502da, this code:

template <typename T> void f() {
  __builtin_expect_with_probability(0, 0, ({ 0; }));
}

produces:

% ~/src/llvm/build/bin/clang++ -fsyntax-only file.cpp
Assertion failed: (!isValueDependent() && "Expression evaluator can't be called on a dependent expression."), function EvaluateAsConstantExpr, file ExprConstant.cpp, line 17122.

WIthout the template, the function compiles successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions