[Bug c++/77846] Wrong error recovery with switch, goto and initialization skipped
denis.campredon at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Oct 4 18:02:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77846
--- Comment #1 from denis.campredon at gmail dot com ---
I'm pretty sure it is linked the following code, compiled with '-fpermissive'
only prints A instead of AB
--------------
enum E{ A, B };
class C {public:C(){};};
static inline
void f(E e) {
if (0)
goto out;
switch (e) {
case A:
__builtin_printf("A");
C c;
break;
case B:
__builtin_printf("B");
}
out:{}
}
int main() {
f(E::B);
f(E::A);
return 0;
}
-----------------
More information about the Gcc-bugs
mailing list