Skip to content

clang assert on invalid with is_constant_evaluated in template argument #142865

Open
@efriedma-quic

Description

@efriedma-quic
template<typename T, int I = 1/!__builtin_is_constant_evaluated()> class X;
void f(X<int, 1>* x) { x->a; }

templateArgumentExpressionsEqual() uses isIntegerConstantExpr(), then EvaluateKnownConstInt()... but they don't agree whether the InConstantContext should be set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyconstexprAnything related to constant evaluation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions