public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51034] New: invalid typeof usage
@ 2011-11-08 17:11 etienne.bergeron at octasic dot com
2011-11-09 1:24 ` [Bug c/51034] " joseph at codesourcery dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: etienne.bergeron at octasic dot com @ 2011-11-08 17:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
Bug #: 51034
Summary: invalid typeof usage
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: etienne.bergeron@octasic.com
This code should not compile:
struct S;
int main()
{
struct S
{
typeof( ((struct S){}) ) x;
} s;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
@ 2011-11-09 1:24 ` joseph at codesourcery dot com
2012-05-02 20:12 ` manu at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: joseph at codesourcery dot com @ 2011-11-09 1:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-11-09 00:41:18 UTC ---
Also applies with sizeof:
struct S { int x[sizeof((struct S){})];} s;
and when the type in the compound literal is not the type being defined:
struct S { int x[sizeof((struct T){})];} s;
All the invalid cases will still be diagnosed with -std=c99
-pedantic-errors because either the empty braces will be diagnosed or
excess elements in an initializer will be diagnosed. But there ought to
be an unconditional hard error for using an incomplete type, other than an
array of unknown size, like that in a compound literal.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
2011-11-09 1:24 ` [Bug c/51034] " joseph at codesourcery dot com
@ 2012-05-02 20:12 ` manu at gcc dot gnu.org
2012-05-02 20:13 ` manu at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2012-05-02 20:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lzie59p1 at frolickingcow
| |dot net
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-05-02 20:11:37 UTC ---
*** Bug 53196 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
2011-11-09 1:24 ` [Bug c/51034] " joseph at codesourcery dot com
2012-05-02 20:12 ` manu at gcc dot gnu.org
@ 2012-05-02 20:13 ` manu at gcc dot gnu.org
2012-06-12 21:16 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2012-05-02 20:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-05-02
CC| |manu at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-05-02 20:13:14 UTC ---
And confirmed. But I don't think anyone will be working on this in the near
future, so any help is welcome.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
` (2 preceding siblings ...)
2012-05-02 20:13 ` manu at gcc dot gnu.org
@ 2012-06-12 21:16 ` jakub at gcc dot gnu.org
2013-02-19 20:37 ` LpSolit at netscape dot net
2013-10-17 20:24 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-12 21:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-12 21:16:24 UTC ---
Author: jakub
Date: Tue Jun 12 21:16:20 2012
New Revision: 188483
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188483
Log:
PR c/53532
PR c/51034
PR c/53196
* c-decl.c (build_compound_literal): Call c_incomplete_type_error
if type isn't complete.
* gcc.dg/pr53532.c: New test.
* gcc.dg/c99-complit-2.c: Add two new dg-error directives,
adjust line numbers.
* gcc.dg/noncompile/950825-1.c: Expect incomplete type error message.
* gcc.dg/Wcxx-compat-8.c: Likewise.
* gcc.dg/pr51034.c: New test.
* gcc.dg/pr53196-1.c: New test.
* gcc.dg/pr53196-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr51034.c
trunk/gcc/testsuite/gcc.dg/pr53196-1.c
trunk/gcc/testsuite/gcc.dg/pr53196-2.c
trunk/gcc/testsuite/gcc.dg/pr53532.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
trunk/gcc/testsuite/gcc.dg/c99-complit-2.c
trunk/gcc/testsuite/gcc.dg/noncompile/950825-1.c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
` (3 preceding siblings ...)
2012-06-12 21:16 ` jakub at gcc dot gnu.org
@ 2013-02-19 20:37 ` LpSolit at netscape dot net
2013-10-17 20:24 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: LpSolit at netscape dot net @ 2013-02-19 20:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-12 21:16:24 UTC ---
Author: jakub
Date: Tue Jun 12 21:16:20 2012
New Revision: 188483
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188483
Log:
PR c/53532
PR c/51034
PR c/53196
* c-decl.c (build_compound_literal): Call c_incomplete_type_error
if type isn't complete.
* gcc.dg/pr53532.c: New test.
* gcc.dg/c99-complit-2.c: Add two new dg-error directives,
adjust line numbers.
* gcc.dg/noncompile/950825-1.c: Expect incomplete type error message.
* gcc.dg/Wcxx-compat-8.c: Likewise.
* gcc.dg/pr51034.c: New test.
* gcc.dg/pr53196-1.c: New test.
* gcc.dg/pr53196-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr51034.c
trunk/gcc/testsuite/gcc.dg/pr53196-1.c
trunk/gcc/testsuite/gcc.dg/pr53196-2.c
trunk/gcc/testsuite/gcc.dg/pr53532.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
trunk/gcc/testsuite/gcc.dg/c99-complit-2.c
trunk/gcc/testsuite/gcc.dg/noncompile/950825-1.c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/51034] invalid typeof usage
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
` (4 preceding siblings ...)
2013-02-19 20:37 ` LpSolit at netscape dot net
@ 2013-10-17 20:24 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-10-17 20:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51034
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |mpolacek at gcc dot gnu.org
Resolution|--- |FIXED
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-10-17 20:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 17:11 [Bug c/51034] New: invalid typeof usage etienne.bergeron at octasic dot com
2011-11-09 1:24 ` [Bug c/51034] " joseph at codesourcery dot com
2012-05-02 20:12 ` manu at gcc dot gnu.org
2012-05-02 20:13 ` manu at gcc dot gnu.org
2012-06-12 21:16 ` jakub at gcc dot gnu.org
2013-02-19 20:37 ` LpSolit at netscape dot net
2013-10-17 20:24 ` mpolacek at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).