We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enums in templated structs do not work on Clang but do work in GCC
Works: enum class E1{aa, bb};
enum class E1{aa, bb};
Does not Work:
template<typename> struct xx{ enum class E{aa, bb}; };
Godbold link with example
https://godbolt.org/z/x3e4rKT89
The text was updated successfully, but these errors were encountered:
weird. It's probably a compiler optimization bug.
If you reference one of the enum value, the problem is gone. https://godbolt.org/z/cj5b1ETxc
Sorry, something went wrong.
gcc works, only clang optimize out enum names:
template<typename T, T v> auto n() { return std::string_view{__PRETTY_FUNCTION__}; } std::cout << n<E2, static_cast<E2>(0)>(); // writes: auto n() [T = xx<int>::E, v = (xx<int>::E)0]
I think it is a limitation because of the compiler optimization. It is need to mentioned on the Limitation page.
No branches or pull requests
Enums in templated structs do not work on Clang but do work in GCC
Works:
enum class E1{aa, bb};
Does not Work:
Godbold link with example
https://godbolt.org/z/x3e4rKT89
The text was updated successfully, but these errors were encountered: