Created
September 30, 2021 02:09
-
-
Save fujii/0d5d95df5f27bb5b61ac73b946297491 to your computer and use it in GitHub Desktop.
wrong overload resolution with a const enum of which value is zero
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://bugs.webkit.org/show_bug.cgi?id=229223#c88 | |
// https://developercommunity.visualstudio.com/t/wrong-overload-resolution-with-a-const-e/1542855?entry=myfeedback&space=62&q=overload+enum+const&stateGroup=active | |
#include <iostream> | |
enum X86Registers { | |
eax, | |
ebx, | |
}; | |
struct ImplicitAddress { | |
ImplicitAddress(X86Registers) { } | |
}; | |
void loadPtr(ImplicitAddress) | |
{ | |
std::cout << "GCC or Clang" << std::endl; | |
} | |
void loadPtr(void*) | |
{ | |
std::cout << "MSVC" << std::endl; | |
} | |
int main() | |
{ | |
const X86Registers regT0 = eax; | |
loadPtr(regT0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment