You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#define DEPTH 3
template<int N> struct R {
static void identity(void *);
static void reduce(void *, void *);
int get(int depth) { return depth <= 0 ? i : field.get(depth - 1); }
public:
R<N - 1> field;
int _Hyperobject(identity, reduce) i;
};
template<> struct R<0> { int field; int get(int) { return field; } };
extern R<DEPTH> r;
int f() { return r.get(DEPTH / 2); }
causes a compiler error:
clang/lib/AST/ExprConstant.cpp:15455: bool clang::Expr::isEvaluatable(const clang::ASTContext&, clang::Expr::SideEffectsKind) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
The text was updated successfully, but these errors were encountered:
on which isValueDependent() returns false. The expansion into a hyperobject lookup has isValueDependent true because of the added references to the identity and reduce members. They may still be the generic versions instead of the R<3> versions.
This code:
causes a compiler error:
The text was updated successfully, but these errors were encountered: