This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21120] Empty declaration with typeof accepted
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2012 10:24:07 +0000
- Subject: [Bug c++/21120] Empty declaration with typeof accepted
- Auto-submitted: auto-generated
- References: <bug-21120-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21120
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|gcc-bugs at gcc dot gnu.org |jason at gcc dot gnu.org
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-03 10:24:07 UTC ---
I think the reason we are not erroring out is that, eg the first snippet, is
parsed like:
struct A {};
void foo() { struct A; }
which is fine (and my guess is consistent with the int case).
In any case, typeof is a very old extension (now obsoleted by decltype in C++)
and we have been accepting the syntax for such a long time, I don't think we
really want to "fix" this anyway. Closing?