-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
Compile error when formatting volatile values before gcc11 #3068
Comments
Looks like a bug in |
Signed-off-by: Vladislav Shchapov <[email protected]>
Not sure why GCC chose the invalid template substitution; since the issue goes away since gcc 11 I am assuming it's a compiler bug. Nice to have a workaround for older compilers though. (maybe note the remove_cv part is for compiler bug workaround in comments?) |
I think it's not a compiler bug. These are valid overloads: template <class T> class variant_size<const T>;
template <class T> class variant_size<volatile T>;
template <class T> class variant_size<const volatile T>; https://en.cppreference.com/w/cpp/utility/variant/variant_size |
Proposed a simplified and clearer implementation coauthored with @phprus |
https://godbolt.org/z/Eq678Tv5M
This failed to compile before gcc11 (gcc7-gcc10); probably introduced in #2941.
The text was updated successfully, but these errors were encountered: