[Bug c++/29834] g++ thinks it is a declaration when it cannot be
ace.of.zerosync at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jul 2 12:10:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29834
--- Comment #8 from M.S. Babaei <ace.of.zerosync at gmail dot com> ---
(In reply to Jonathan Wakely from comment #7)
> You can use list-initialization to workaround it:
>
> Doh{x}, ++x;
Thanks for the reply. Yeah, it did the trick for GCC 4.4+. And, I've never
thought of that.
But this is a bug, and I see no reason why it hasn't been fixed anyway.
However, your solution works fine with only C++11 enabled projects. Although,
this is not a problem for me, because it has been virtually three years that my
default mode for any new project is C++11. But, it might still be a problem for
others.
Thanks again, you saved me a lot of headaches.
More information about the Gcc-bugs
mailing list