https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

            Bug ID: 83165
           Summary: [8 regression] cannot convert ‘GPrivate’ {aka
                    ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in
                    return
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

This issue appear in clipsmm build with gcc 8. gcc 7.2.1 build work fine.

$ cat environment.i.cpp
typedef struct _GPrivate GPrivate;
struct _GPrivate {};
template <class> class a {
  GPrivate *b() { return c; }
  GPrivate c;
};


### Fail with GCC 8.0

$g++ --version
g++ (GCC) 8.0.0 20171124 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -pthread -g -O2 -std=c++0x  -c environment.i.cpp  -fPIC  -o
environment.i.cpp.o
environment.i.cpp: In member function ‘GPrivate* a< <template-parameter-1-1>
>::b()’:
environment.i.cpp:4:26: error: cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to
‘GPrivate*’ {aka ‘_GPrivate*’} in return
   GPrivate *b() { return c; }
                          ^
### Pass with GCC 7.2.1

$g++ --version
g++ (GCC) 7.2.1 20171124
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -pthread -g -O2 -std=c++0x  -c environment.i.cpp  -fPIC  -o
environment.i.cpp.o
$ echo $?
0

Reply via email to