akashagrwl wrote:
I've reworked this to bail out earlier instead of touching the initialization
fast path. ActOnDecompositionDeclarator already marks the declaration invalid
for function types ("won't work here"); I've extended that to array types,
which are the same case: a structured binding's type is always deduced, so an
explicit array bound is meaningless and is exactly what fed a mismatched type
into the array-copy path and tripped the assert. Marking the decl invalid means
AddInitializerToDecl skips initialization entirely, so no init is performed and
we emit only the "must be 'auto'" diagnostic. Record/CTAD types still fall
through and keep their useful "binds to N elements" diagnostics, so nothing is
lost there.
https://github.com/llvm/llvm-project/pull/210964
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits