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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
A similar example

extern const int z;
template<int> constexpr auto p = z;

works, because require_constant_expression is OK with 'z' here.  The difference
between 'z' here and 'q' in the previous test is
INTEGRAL_OR_ENUMERATION_TYPE_P, which makes decl_maybe_constant_var_p return
different answers:

  else if (CP_TYPE_CONST_NON_VOLATILE_P (type)
           && INTEGRAL_OR_ENUMERATION_TYPE_P (type))
    /* And const integers.  */;

Reply via email to