make_pack_expansion used mark_exp_read, which misses reads nested
  inside dependent operators and calls.  If an expansion is empty,
  instantiation loses the pattern and can produce spurious
  -Wunused-but-set diagnostics.

  This patch walks expansion patterns with read, discarded-value, and
  write contexts, including nested folds and base-initializer packs.
  It therefore preserves genuine reads without hiding write-only
  warnings.

  Tested on x86_64-pc-linux-gnu with all-gcc and check-g++.  The only
  unexpected result was the pre-existing g++.dg/guality/pr55665.C
  failure.

  Odysseas

Attachment: PR56958.patch
Description: PR56958.patch

Reply via email to