#include <iostream>
enum class key {A, B};
void test(key k)
{
switch (k)
{
case key::A:
std::cerr << "A\n";
break;
deafult: // HERE!!!
std::cerr << "DFL\n";
break;
}
}
int main(int argc, char* argv[])
{
test(key::A);
test(key::B);
}
but it does:
xxx$ g++ -pedantic -o run run.cpp
xxx$ ./run
A
xxx$
I am using Debian GNU/Linux 13 (trixie), kernel 6.12.113-1 x86_64. Best regards.
Although I agree you've misspelled "default", this is nevertheless legal because it looks just like a label, and you're allowed to have a label named "deafult".