Changeset 0661b27 in Lumiera

Timestamp:
2026-10-01T00:57:44Z (10 days ago)
Author:
Ichthyostega <prg@…>
Branches:
dev/play
Children:
f0cdb2f
Parents:
109d682
git-author:
Ichthyostega <prg@…> (01/10/26 22:02:40)
git-committer:
Ichthyostega <prg@…> (01/10/26 00:57:44)
Message:

clean-up: resolve some Clang conformance divergences (see #928)

Knowledge-Technology(Claude Opus 5) used

  • to analyse and reassess the situation
  • to discuss and weigh the findings and develop solutions
  • to perform the selected mitigation and verify success

Report by Claude

A sweep with Clang-22 over all 597 translation units (driven from the newly
generated compilation database) showed 271 of them failing, yet with the
2502 diagnostics tracing back to very few root sites. This resolves those
where GCC is simply the more permissive of the two; the remaining clusters
are a matter of design and are left alone for now.

  • using Alias::OriginalName; does *not* declare inherited constructors. Per [namespace.udecl] a using-declarator names constructors only when its terminal name equals the last component of the nested-name-specifier -- so through an alias, the terminal name is read as the injected-class-name, i.e. a type, and Clang then demands typename. Clang is right here. Affects hetero-data.hpp (19 TUs) and iter-source.hpp (62 TUs); in the latter the alias is renamed _I -> Adapter while we are at it. Note iter-source as a whole awaits a design review, see #1125
  • P1787R6 requires a template-argument-list after the template keyword. holder.template emplace (...) in opaque-holder.hpp and two sites in node-builder.hpp supply none, so the keyword has to go (83 TUs).
  • A default template argument may be given only once per scope. The out-of-class definition of OutputSlot::AllocState repeated the default from its declaration in 'output-slot.hpp' -- note the friend-declaration further down in the same header already got this right.
  • constexpr auto ROUGH_PRECISION = pow (10, -3) is not a constant expression by the standard; only GCC accepts it, through a builtin. Hence util::ipow() in 'util-quant.hpp', an exponentiation with integral exponent by square-and-multiply, as a counterpart to ilog2(). Exact for representable base and result, and the static_assert documents that ipow(10.0,-3) is bit-identical to 1e-3. 193 TUs depended on this single line.

Furthermore, two findings made while surveying:

  • lib/stat/statistic.hpp held a second, dormant instance of the same pow problem, in a round<places>() helper that nothing in Lumiera ever instantiates -- which is why Clang never saw it. Since the helper is also the naive and imprecise formulation, it is removed here; a note records that it stays in use upstream in yoshimi-test, where this header comes from, and that decimal rounding belongs to #1360 if ever wanted here.
  • The alias DataBuilder was defined twice, identically, in 'weaving-pattern-builder.hpp' and in 'node-builder.hpp' which includes the former. Both compilers tolerate the duplicate definition and only Clang objects to the repeated default argument, which is why this went unnoticed. The duplicate is dropped and its documentation moved to the surviving definition -- together with a @todo, since DataBuilder, SizMark and UseHeapAlloc are vocabulary of the node-builder DSL and reside where they do by accident of include order.
(No files)

Note: See TracChangeset for help on using the changeset viewer.