Skip to content

[intro.object] The template parameter object of type const std::array<T, 0> seems to be conditionally potentially non-unique #8568

@frederick-vs-ja

Description

@frederick-vs-ja

std::meta::reflect_constant_array sometimes reflects the template parameter object of type const std::array<T, 0> initialized with {}. Such an object can also be introduced by other language constructs.

Such a template parameter object can also be introduced by other constructs, and we don't say it is potentially non-unique in these cases. So it seems that given the following example:

#include <array>

template<std::array<int, 0> A>
constexpr bool f() {
  std::initializer_list<std::array<int, 0>> il{{}};
  return &A != il.begin();
}
static_assert(f<{}>());

Whether it's guaranteed to be well-formed depends on whether the template parameter object has been reflected by std::meta::reflect_constant_array.

Not sure whether this needs a CWG/LWG issue because the current specification is still implementable (since an implementation can always treat the template parameter object unique). But the wording seemingly indicates some weird status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions