[Bug c++/71420] "‘type’ is not a class type" error for address-of operator overloaded for enum type

flashmozzg at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Jun 5 15:46:00 GMT 2016


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

flashmozzg at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |flashmozzg at gmail dot com

--- Comment #1 from flashmozzg at gmail dot com ---
There is even smaller example which compiles fine on Clang but fails in every
gcc:
https://godbolt.org/g/LTZZRc

#include <iostream>
#include <typeinfo>
using namespace std;

enum test {
        A = 0
};

constexpr test operator &(test value)
{
        return value;
}

template<typename D, typename T = decltype(&D::A)>
void printt() {
        cout << typeid(T).name() << endl;
}

int main() {
        printt<test>();

        return 0;
}


More information about the Gcc-bugs mailing list