[Bug c++/78358] [7 Regression] wrong types for std::tuple decomposition
rs2740 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 15 10:12:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78358
TC <rs2740 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rs2740 at gmail dot com
--- Comment #4 from TC <rs2740 at gmail dot com> ---
In particular, [dcl.type.simple]/4, bullet 1:
> if e is an unparenthesized id-expression naming an lvalue or
> reference introduced from the identifier-list of a decomposition
> declaration, decltype(e) is the referenced type as given in the
> specification of the decomposition declaration ([dcl.decomp]);
And [dcl.decomp]/3 specifies that the referenced type for the i-th identifier
is std::tuple_element<i, E>::type:
> Otherwise, if the expression std::tuple_size<E>::value is a
> well-formed integral constant expression [...] Given the type
> Ti designated by std::tuple_element<i, E>::type, each vi is
> a variable of type “reference to Ti” initialized with the
> initializer, where the reference is an lvalue reference if
> the initializer is an lvalue and an rvalue reference otherwise;
> the referenced type is Ti.
More information about the Gcc-bugs
mailing list