Commit Graph

9 Commits

Author SHA1 Message Date
Richard Smith 7a6182d48d PR40674: fix assertion failure if a structured binding declaration has a
tuple-like decomposition that produces value-dependent reference
bindings.

llvm-svn: 369829
2019-08-24 01:23:57 +00:00
Reid Kleckner ed399a69e2 [Sema] Implement DR2386 for C++17 structured binding
Allow implementations to provide complete definitions of
std::tuple_size<T>, but to omit the 'value' member to signal that T is
not tuple-like. The Microsoft standard library implements
std::tuple_size<const T> this way.

If the value member exists, clang still validates that it is an ICE, but
if it does not, then the type is considered to not be tuple-like.

Fixes PR33236

Reviewers: rsmith

Differential Revision: https://reviews.llvm.org/D66040

llvm-svn: 369043
2019-08-15 19:45:28 +00:00
Richard Smith 5c9b3b7576 P0969R0: allow structured binding of accessible members, not only public members.
llvm-svn: 343036
2018-09-25 22:12:44 +00:00
Erik Pilkington be168a9d34 [Sema] P0961R1: Relaxing the structured bindings customization point finding rules
Differential revision: https://reviews.llvm.org/D50418

llvm-svn: 339375
2018-08-09 20:11:13 +00:00
Richard Smith 378b8c8f01 [c++1z] P0217R3: Allow by-value structured binding of arrays.
llvm-svn: 289630
2016-12-14 03:22:16 +00:00
Richard Smith 208732e954 [c++1z] P0490R0, NB comment GB 20: if std::tuple_size<T> is complete, use the
tuple-like interpretation of decomposition declaration even if there is no
::value member. We already did this, anticipating this resolution, just update
comments and tweak a testcase.

llvm-svn: 289021
2016-12-08 03:24:55 +00:00
Benjamin Kramer df8bf140dd [C++1z] Fix crash when decomposing structs with anonymous members.
The diagnostic format was invalid.

llvm-svn: 278487
2016-08-12 09:19:34 +00:00
Richard Smith dca60b4958 P0217R3: Constant expression evaluation for decomposition declarations.
llvm-svn: 278447
2016-08-12 00:39:32 +00:00
Richard Smith 7873de0cf6 P0217R3: Perform semantic checks and initialization for the bindings in a
decomposition declaration for arrays, aggregate-like structs, tuple-like
types, and (as an extension) for complex and vector types.

llvm-svn: 278435
2016-08-11 22:25:46 +00:00