* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
@ 2012-01-16 18:14 ` paolo.carlini at oracle dot com
2012-01-31 16:25 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 18:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-16 18:10:46 UTC ---
I'm still not sure an error message should be triggered in the first place.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
2012-01-16 18:14 ` [Bug c++/51786] " paolo.carlini at oracle dot com
@ 2012-01-31 16:25 ` paolo.carlini at oracle dot com
2012-01-31 22:09 ` daniel.kruegler at googlemail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-31 16:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com,
| |paolo.carlini at oracle dot
| |com
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-31 15:56:47 UTC ---
Hi Daniel, are you willing to help triaging this?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
2012-01-16 18:14 ` [Bug c++/51786] " paolo.carlini at oracle dot com
2012-01-31 16:25 ` paolo.carlini at oracle dot com
@ 2012-01-31 22:09 ` daniel.kruegler at googlemail dot com
2012-01-31 22:24 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-01-31 22:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-01-31 21:26:41 UTC ---
It seems to me that all these examples should be rejected (Thanks to Jens
Maurer for helping me here): At first it seems, that we can follow the grammar
chain starting from /declaration/ in 7 [dcl.dcl] via
simple-declaration => decl-specifier-seq_opt init-declarator-list_opt;
without the optional init-declarator-list reaching
decl-specifier => type-specifier => trailing-type-specifier =>
simple-type-specifier => decltype(expression).
But the show-stopper for this is 7 [dcl.dcl] p3:
"In a simple-declaration, the optional init-declarator-list can be omitted only
when declaring a class (Clause 9) or enumeration (7.2), that is, when the
decl-specifier-seq contains either a class-specifier, an elaborated-type-
specifier with a class-key (9.1), or an enum-specifier. [..]"
Neither of these three situations applies, so this is no valid
/simple-declaration/.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
` (2 preceding siblings ...)
2012-01-31 22:09 ` daniel.kruegler at googlemail dot com
@ 2012-01-31 22:24 ` paolo.carlini at oracle dot com
2012-10-16 10:49 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-31 22:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-01-31
CC|paolo.carlini at oracle dot |
|com |
Ever Confirmed|0 |1
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-31 21:37:08 UTC ---
Ah, thanks a lot Daniel (and Jens). Let's confirm this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
` (3 preceding siblings ...)
2012-01-31 22:24 ` paolo.carlini at oracle dot com
@ 2012-10-16 10:49 ` paolo.carlini at oracle dot com
2013-07-06 22:49 ` paolo.carlini at oracle dot com
2013-07-07 13:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-16 10:49 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
` (4 preceding siblings ...)
2012-10-16 10:49 ` paolo.carlini at oracle dot com
@ 2013-07-06 22:49 ` paolo.carlini at oracle dot com
2013-07-07 13:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-06 22:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |0coming.soon at gmail dot com
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 57502 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/51786] [c++0x] Invalid declaration with decltype accepted
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
` (5 preceding siblings ...)
2013-07-06 22:49 ` paolo.carlini at oracle dot com
@ 2013-07-07 13:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-07 13:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
On it.
^ permalink raw reply [flat|nested] 8+ messages in thread