[ub] Proposal: make self-initialized references ill-formed (C++17?)

Jens Maurer Jens.Maurer at gmx.net
Mon Sep 22 18:02:08 CEST 2014


On 09/22/2014 02:15 PM, John Zwinck wrote:
> The initializer shall not mention the reference being initialized.

So, something like the following would be ill-formed?

const int& i = sizeof(i);
const int& j = f<decltype(j)>();


> Any use of a reference which has not yet been initialized is
> ill-formed.

That seems unimplementable, because order-of-initialization
for global variables is unspecified between translation units.

Jens


More information about the ub mailing list