public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44122]  New: Confusing error: cannot convert 'T*’ to ‘T*’
@ 2010-05-13 18:53 ppluzhnikov at google dot com
  2010-05-15  0:16 ` [Bug c++/44122] Confusing error: cannot convert 'T*' to 'T*' manu at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: ppluzhnikov at google dot com @ 2010-05-13 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

Here is the complete error message:

g++ -c t.cc
t.cc: In function ‘int bar()’:
t.cc:8:18: error: cannot convert ‘Py_ssize_t*’ to ‘Py_ssize_t*’ for argument
‘1’ to ‘int foo(Py_ssize_t*)’

How is that even possible?

cat t.cc
typedef long Py_ssize_t;

int foo(Py_ssize_t *);

int bar() {
  typedef int Py_ssize_t;
  Py_ssize_t pos;
  return foo(&pos);
}

Suggested improvement:

t.cc:8: error: cannot convert '{bar}::Py_ssize_t* [int*]' to 'Py_ssize_t*
[long*]' for 1st argument to 'int foo(Py_ssize_t*)'


-- 
           Summary: Confusing error: cannot convert 'T*’ to ‘T*’
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ppluzhnikov at google dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-44122-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-07-20 20:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-13 18:53 [Bug c++/44122] New: Confusing error: cannot convert 'T*’ to ‘T*’ ppluzhnikov at google dot com
2010-05-15  0:16 ` [Bug c++/44122] Confusing error: cannot convert 'T*' to 'T*' manu at gcc dot gnu dot org
2010-05-15  0:47 ` redi at gcc dot gnu dot org
2010-05-15  0:55 ` manu at gcc dot gnu dot org
2010-05-15  0:59 ` ppluzhnikov at google dot com
2010-07-24 21:17 ` [Bug c++/44122] Confusing error: cannot convert 'T*' to 'T*' (when T are different scopes) pinskia at gcc dot gnu dot org
     [not found] <bug-44122-4@http.gcc.gnu.org/bugzilla/>
2014-07-20 20:53 ` ppluzhnikov at google 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).