https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111286

Gayathri Gottumukkala <gayathri.gottumukkala.27 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gayathri.gottumukkala.27@gm
                   |                            |ail.com

--- Comment #3 from Gayathri Gottumukkala <gayathri.gottumukkala.27 at gmail 
dot com> ---
I think this issue is related to the attempt to create a temporary array of
references, which is not allowed in C++.

In C++11 and later, you can find this information in section 8.3.2, paragraph 4
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf

According to the above document, "There shall be no references to references,
no arrays of references, and no pointers to references."

To address the compilation error without modifying the code structure, we can
make use of a temporary array of const A objects.

struct A {
    A() noexcept {}
};

void foo() {
    using T = const A[1];
    T{};
}

Reply via email to