public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42067]  New: Misleading error message for misusing a type
@ 2009-11-16 16:59 jlquinn at optonline dot net
  2009-11-16 17:02 ` [Bug c++/42067] " pinskia at gcc dot gnu dot org
  2009-11-16 17:05 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: jlquinn at optonline dot net @ 2009-11-16 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

The following small test drove me crazy and had me convinced that gcc 4.4 had
regressed.  I had the C++ spec out too trying to understand exactly how string
is declared until I eventually saw the actual problem, which is that the first
parameter is named 'string'.

I'm not sure exactly how to improve the error message here.  4.3 and earlier
accept this code.


#include <string>
using std::string;
int fn(string& string, string& head);

g++-4.4 -c junk.C
junk.C:3: error: ‘string’ is not a type


-- 
           Summary: Misleading error message for misusing a type
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jlquinn at optonline dot net


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


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

* [Bug c++/42067] Misleading error message for misusing a type
  2009-11-16 16:59 [Bug c++/42067] New: Misleading error message for misusing a type jlquinn at optonline dot net
@ 2009-11-16 17:02 ` pinskia at gcc dot gnu dot org
  2009-11-16 17:05 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-16 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-11-16 17:02 -------
Well you are not misusing a type here really.  
The second string causes string to be a variable name, so the error message is
correct as it is no longer a type at that point.


-- 


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


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

* [Bug c++/42067] Misleading error message for misusing a type
  2009-11-16 16:59 [Bug c++/42067] New: Misleading error message for misusing a type jlquinn at optonline dot net
  2009-11-16 17:02 ` [Bug c++/42067] " pinskia at gcc dot gnu dot org
@ 2009-11-16 17:05 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-16 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2009-11-16 17:04 -------
Comeau online tester gives:

"ComeauTest.c", line 4: error: parameter "string" is not a type name
  int fn(string& string, string& head);

Which is only slightly better.

The trunk gives a column number:
t.cc:3:24: error: 'string' is not a type

Which shows where the problem is.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


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


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

* [Bug c++/42067] Misleading error message for misusing a type
       [not found] <bug-42067-4@http.gcc.gnu.org/bugzilla/>
@ 2013-06-16 23:05 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-06-16 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|gcc-bugs at gcc dot gnu.org        |
      Known to work|                            |4.8.0, 4.9.0
         Resolution|---                         |FIXED

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I think it's safe to say that this is fixed.


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

end of thread, other threads:[~2013-06-16 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-16 16:59 [Bug c++/42067] New: Misleading error message for misusing a type jlquinn at optonline dot net
2009-11-16 17:02 ` [Bug c++/42067] " pinskia at gcc dot gnu dot org
2009-11-16 17:05 ` pinskia at gcc dot gnu dot org
     [not found] <bug-42067-4@http.gcc.gnu.org/bugzilla/>
2013-06-16 23:05 ` paolo.carlini at oracle dot com

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).