This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51786] [c++0x] Invalid declaration with decltype 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, 16 Oct 2012 10:49:22 +0000
- Subject: [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
- Auto-submitted: auto-generated
- References: <bug-51786-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-16 10:49:22 UTC ---
The problem is that by the time at the end of cp_parser_simple_declaration we
call check_tag_decl (via shadow_tag), which is supposed to check that the
simple declaration is valid, we already called finish_decltype_type thus it
doesn't see the decltype, it sees something like:
void foo() { struct A; }
a valid simple declaration.