[Bug c++/89429] ICE with __func__

vakevk at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 21 08:10:00 GMT 2019


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

--- Comment #1 from Valentin <vakevk at gmail dot com> ---
Sorry, this was the wrong attachment.

The proper code is:


template <typename Function>
void f(Function&& function) {
    // `0` is not special. Can be any value of any type.
    function(0);
}

// No error when this template parameter is removed.
template<typename T>
void g() {
    // Must be `auto`.
    f([](auto) {
        __func__;
    });
}

void h() {
    // `int` is not special. Can be any type. 
    g<int>();
}


More information about the Gcc-bugs mailing list