public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33101]  New: C++ error on valid code: <anonymous> has incomplete type
@ 2007-08-17 23:32 ian at airs dot com
  2007-08-17 23:33 ` [Bug c++/33101] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ian at airs dot com @ 2007-08-17 23:32 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

This C++ test case works with gcc 4.1.1.  With gcc 4.2 and with mainline it
gets an inexplicable error.

typedef void v;
typedef v (*pf)(v);

foo.cc:2: error: ‘<anonymous>’ has incomplete type
foo.cc:2: error: invalid use of ‘v’


-- 
           Summary: C++ error on valid code: <anonymous> has incomplete type
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] C++ error on valid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
@ 2007-08-17 23:33 ` pinskia at gcc dot gnu dot org
  2007-08-18  4:19 ` ian at airs dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-08-17 23:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-08-17 23:33 -------
This is not valid code.

*** This bug has been marked as a duplicate of 9278 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] C++ error on valid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
  2007-08-17 23:33 ` [Bug c++/33101] " pinskia at gcc dot gnu dot org
@ 2007-08-18  4:19 ` ian at airs dot com
  2007-08-18  8:54 ` [Bug c++/33101] Bad C++ error on invalid " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ian at airs dot com @ 2007-08-18  4:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ian at airs dot com  2007-08-18 04:19 -------
Thanks for the explanation.  That is new to me.

I am now going to reopen this bug because the error message is terrible.  There
is no anonymous or incomplete type here.  gcc should perhaps print something
like

error: invalid use of typedef 'v' in function parameter declaration


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
  2007-08-17 23:33 ` [Bug c++/33101] " pinskia at gcc dot gnu dot org
  2007-08-18  4:19 ` ian at airs dot com
@ 2007-08-18  8:54 ` pinskia at gcc dot gnu dot org
  2007-08-18  9:00 ` schwab at suse dot de
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-08-18  8:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |diagnostic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (2 preceding siblings ...)
  2007-08-18  8:54 ` [Bug c++/33101] Bad C++ error on invalid " pinskia at gcc dot gnu dot org
@ 2007-08-18  9:00 ` schwab at suse dot de
  2007-08-18 17:12 ` ian at airs dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schwab at suse dot de @ 2007-08-18  9:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from schwab at suse dot de  2007-08-18 09:00 -------
The error message makes perfect sense: void is an incomplete type and the
formal parameter has no name.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (3 preceding siblings ...)
  2007-08-18  9:00 ` schwab at suse dot de
@ 2007-08-18 17:12 ` ian at airs dot com
  2007-08-18 17:15 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ian at airs dot com @ 2007-08-18 17:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ian at airs dot com  2007-08-18 17:12 -------
The error message makes some sense if you already understand the issue.  If you
do not know what the problem is, then I believe it is completely obscure.  This
is particularly so since the same code is valid C code.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (4 preceding siblings ...)
  2007-08-18 17:12 ` ian at airs dot com
@ 2007-08-18 17:15 ` pinskia at gcc dot gnu dot org
  2007-08-18 17:29 ` fang at csl dot cornell dot edu
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-08-18 17:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-08-18 17:15 -------
Here is my quote for today:
Stop programming in C using a C++ compiler.  Learn C+.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (5 preceding siblings ...)
  2007-08-18 17:15 ` pinskia at gcc dot gnu dot org
@ 2007-08-18 17:29 ` fang at csl dot cornell dot edu
  2007-08-18 19:52 ` gdr at cs dot tamu dot edu
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fang at csl dot cornell dot edu @ 2007-08-18 17:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from fang at csl dot cornell dot edu  2007-08-18 17:29 -------
Subject: Re:  Bad C++ error on invalid code: <anonymous> has
 incomplete type

> ------- Comment #5 from pinskia at gcc dot gnu dot org  2007-08-18 17:15 -------
> Here is my quote for today:
> Stop programming in C using a C++ compiler.  Learn C+.

Haha.  And I keep telling people to
"Stop programming in C.  [Period.]  Learn C++."

(ok, that's perhaps too extreme)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (6 preceding siblings ...)
  2007-08-18 17:29 ` fang at csl dot cornell dot edu
@ 2007-08-18 19:52 ` gdr at cs dot tamu dot edu
  2007-08-18 22:10 ` ian at airs dot com
  2007-09-08 23:25 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: gdr at cs dot tamu dot edu @ 2007-08-18 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from gdr at cs dot tamu dot edu  2007-08-18 19:52 -------
Subject: Re:  C++ error on valid code: <anonymous> has incomplete type

"ian at airs dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| Thanks for the explanation.  That is new to me.

Check for "abomination" in D&E :-)

| I am now going to reopen this bug because the error message is terrible. 
There
| is no anonymous or incomplete type here.

Well, I believe the parameter is unnamed, and its type is incomplete.

|  gcc should perhaps print something
| like
| 
| error: invalid use of typedef 'v' in function parameter declaration

That is also obscure :-)

Maybe you want

  error: invalid use of typedef-name for type 'void' in a function
         parameter declaration
  note: 'void' can be used as a function parameter only if it appears
        lexically as a keyword

?

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (7 preceding siblings ...)
  2007-08-18 19:52 ` gdr at cs dot tamu dot edu
@ 2007-08-18 22:10 ` ian at airs dot com
  2007-09-08 23:25 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ian at airs dot com @ 2007-08-18 22:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ian at airs dot com  2007-08-18 22:10 -------
Works for me.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/33101] Bad C++ error on invalid code: <anonymous> has incomplete type
  2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
                   ` (8 preceding siblings ...)
  2007-08-18 22:10 ` ian at airs dot com
@ 2007-09-08 23:25 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2007-09-08 23:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from bangerth at dealii dot org  2007-09-08 23:24 -------
This sounds good to me to. I guess we can now confirm the PR.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-08 23:24:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-09-08 23:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17 23:32 [Bug c++/33101] New: C++ error on valid code: <anonymous> has incomplete type ian at airs dot com
2007-08-17 23:33 ` [Bug c++/33101] " pinskia at gcc dot gnu dot org
2007-08-18  4:19 ` ian at airs dot com
2007-08-18  8:54 ` [Bug c++/33101] Bad C++ error on invalid " pinskia at gcc dot gnu dot org
2007-08-18  9:00 ` schwab at suse dot de
2007-08-18 17:12 ` ian at airs dot com
2007-08-18 17:15 ` pinskia at gcc dot gnu dot org
2007-08-18 17:29 ` fang at csl dot cornell dot edu
2007-08-18 19:52 ` gdr at cs dot tamu dot edu
2007-08-18 22:10 ` ian at airs dot com
2007-09-08 23:25 ` bangerth at dealii dot 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).