https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57248

--- Comment #7 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Paolo Carlini from comment #6)
> However, it's true that all the up to
> date compilers I have at hand reject it with the same kind of error about
> get at:
> 
>    return std::get<index(array)>(t1);
> 
> like for my reduced testcase in Comment #5.

Ouch, you are right - I overlooked the very important fact that *within*
function extract the expression

index(array)

cannot be a constant expression, because we have an argument value involved! In
the context of a constexpr function any argument value itself cannot be a
constant expression, because the decision for something being a constant
expression is always context-independent.

I'm very sorry for having mislead Paolo with my original remark, indeed the
original test case is *invalid* because it is based on the assumption that a
constexpr function argument itself could be a constant expression.

Reply via email to