Commit Graph

12 Commits

Author SHA1 Message Date
David Blaikie aee4925507 Recommit: Compress formatting of array type names (int [4] -> int[4])
Based on post-commit review discussion on
2bd8493847 with Richard Smith.

Other uses of forcing HasEmptyPlaceHolder to false seem OK to me -
they're all around pointer/reference types where the pointer/reference
token will appear at the rightmost side of the left side of the type
name, so they make nested types (eg: the "int" in "int *") behave as
though there is a non-empty placeholder (because the "*" is essentially
the placeholder as far as the "int" is concerned).

This was originally committed in 277623f4d5

Reverted in f9ad1d1c77 due to breakages
outside of clang - lldb seems to have some strange/strong dependence on
"char [N]" versus "char[N]" when printing strings (not due to that name
appearing in DWARF, but probably due to using clang to stringify type
names) that'll need to be addressed, plus a few other odds and ends in
other subprojects (clang-tools-extra, compiler-rt, etc).
2021-10-21 11:34:43 -07:00
David Blaikie f9ad1d1c77 Revert "Compress formatting of array type names (int [4] -> int[4])"
Looks like lldb has some issues with this - somehow it causes lldb to
treat a "char[N]" type as an array of chars (prints them out
individually) but a "char [N]" is printed as a string. (even though the
DWARF doesn't have this string in it - it's something to do with the
string lldb generates for itself using clang)

This reverts commit 277623f4d5.
2021-10-14 14:49:25 -07:00
David Blaikie 277623f4d5 Compress formatting of array type names (int [4] -> int[4])
Based on post-commit review discussion on
2bd8493847 with Richard Smith.

Other uses of forcing HasEmptyPlaceHolder to false seem OK to me -
they're all around pointer/reference types where the pointer/reference
token will appear at the rightmost side of the left side of the type
name, so they make nested types (eg: the "int" in "int *") behave as
though there is a non-empty placeholder (because the "*" is essentially
the placeholder as far as the "int" is concerned).
2021-10-14 14:23:32 -07:00
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