Package: g++ Version: 4:14.2.0-1
The following code compilation should never success:

#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.

Reply via email to