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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
finish_decltype_type does:
      /* decltype of a decomposition name drops references in the tuple case
         (unlike decltype of a normal variable) and keeps cv-qualifiers from
         the containing object in the other cases (unlike decltype of a member
         access expression).  */
      if (DECL_DECOMPOSITION_P (expr))
        {
          if (DECL_HAS_VALUE_EXPR_P (expr))
            /* Expr is an array or struct subobject proxy, handle
               bit-fields properly.  */
            return unlowered_expr_type (expr);
          else
            /* Expr is a reference variable for the tuple case.  */
            return lookup_decomp_type (expr);
        }
The problem is that if processing_template_decl (though, finish_decltype_type
has processing_template_decl temporarily cleared here) and expr is not
dependent (otherwise finish_decltype_type would defer handling it)
DECL_HAS_VALUE_EXPR_P is actually set on all the structured binding decls, not
just when it is array/struct/vector/complex etc. subobject proxy.

Reply via email to