This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44122] New: Confusing error: cannot convert 'T*’ to ‘T*’


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]