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

--- Comment #3 from Jonathan Stein <jstein27 at binghamton dot edu> ---
Last update on this for today from me: If there is a difference between "type
of" the operator and the operator itself language wise, then there's a
different but related regression that appears to break standards conformity:
the type now does not get attributes (such as deprecated) applied to it,
whereas it previously did (and so did use of the lambda, but now it correctly
does not).

Compiler explorer and codesnippet: https://gcc.godbolt.org/z/8WGvPsaGh

#include <cstdio>
#include <type_traits>

static auto l1 = [](int v) [[deprecated]]
{
    printf("%d\n", v * 2);
};
using t1 [[deprecated]] = long;

int main() {
    decltype(&std::decay_t<decltype(l1)>::operator()) test;
    decltype(t1{}) test2;
    l1(1); // test 3 
}

Reply via email to