Meaning of "ill-formed declaration" in L(n)

  ambiguity, c++, constructor, declaration

A code snippet from cppreference.com is like this:

struct M { };
struct L { L(M&); };
 
M n;
void f() {
    M(m); // declaration, equivalent to M m;
    L(n); // ill-formed declaration
    L(l)(m); // still a declaration
}

L(n); is commented with "ill-formed declaration".

But nearly all compilers issue message like this: no default constructor exists for class "L". That is to say, it’s not considered to be ill-formed, right? Because if i throw a line L() = default; into L’s body, it compiles successfully.

Is the comment wrong or misleading or compilers are not strictly standard-conforming?

Source: Windows Questions C++

LEAVE A COMMENT