Closed WebDancer69 closed 2 weeks ago
I used x86-64 gcc (trunk) (currently 15.0.0 20240828 experimental) with Compiler Explorer.
Please see #148 and #311.
Thanks for reporting! By "has compilation errors", do you mean it fails to compile on a particular compiler (gcc) or that the standard says it should not compile?
If you click the compiler explorer link in the question, you can see that this compiles fine with clang and msvc. The explanation to the question also explains why this is, in fact, legal C++. I believe this is a bug in gcc, unless you take issue with anything in particular in the explanation to the question. Please re-open if you disagree.
I agree, it seems it (still) is a gcc bug.
This seems to work in gcc:
virtual override f() override {
std::cout << "1";
return override();
}
Question #231 has compilation errors, but does not accept that as the answer.