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

--- Comment #4 from Csaba Ráduly <csaba_22 at yahoo dot co.uk> ---
Looks like there *was* a  bug, I just wasn't  able to properly reproduce it
initially:

#include <type_traits>
#include <utility>

class CB {
    struct DCB {};
};

struct  NMC1 : public CB {
    int meow() const { return __LINE__; }
};

struct CC {
    template <typename ... Args>
    int  meow(Args&&... args) {
        if constexpr(std::is_same_v<
decltype(std::declval<NMC1>().meow(std::forward<Args>(args)...)), CB::DCB>) {
            return __LINE__;
        }
        else {
            return __LINE__;
        }
    }
};

int main()
{
    CC  cc;
    return  cc.meow();
}

(accepted  by GCC 10, rejected by clang and GCC11).

https://godbolt.org/z/81rWdf6v8

This has been fixed  between GCC 10.3 and 11.1

Reply via email to