[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2021-08-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #9 from Andrew Pinski  ---
Dup of bug 78704.

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

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread grzebieluch at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

Marcin Grzebieluch  changed:

   What|Removed |Added

 CC||grzebieluch at me dot com

--- Comment #8 from Marcin Grzebieluch  ---
Error is also present on Archlinux gcc 7.1.1:

$g++ -c -v test.cpp
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release
Thread model: posix
gcc version 7.1.1 20170516 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/cc1plus -quiet -v -D_GNU_SOURCE
test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test
-version -o /tmp/cchLcJgH.s
GNU C++14 (GCC) version 7.1.1 20170516 (x86_64-pc-linux-gnu)
compiled by GNU C version 7.1.1 20170516, GMP version 6.1.2, MPFR
version 3.1.5-p2, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1

/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include-fixed
 /usr/include
End of search list.
GNU C++14 (GCC) version 7.1.1 20170516 (x86_64-pc-linux-gnu)
compiled by GNU C version 7.1.1 20170516, GMP version 6.1.2, MPFR
version 3.1.5-p2, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 74aace2f6deb87bb86dbfd7a28ebe524
test.cpp: In function ‘void problem()’:
test.cpp:24:7: error: result of ‘operator->()’ yields non-pointer result
 op->doNothing();
   ^~

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #7 from bartek 'basz' szurgot  ---
maybe it's more related to a particular set of configuration parameters /
features enabled, then the released version?

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #6 from Jonathan Wakely  ---
There's something strange about the Debian package then.

$ cat np.cc
struct S
{
  int i;
};

template
struct T
{
auto operator->() { return  }
S s;
};

template
void problem(T& t)
{
t->i;
}
$ ~/gcc/7.1.0/bin/g++ -c -v np.cc 
Using built-in specs.
COLLECT_GCC=/home/jwakely/gcc/7.1.0/bin/g++
Target: x86_64-pc-linux-gnu
Configured with: /home/jwakely/src/gcc/gcc-7/configure
--prefix=/home/jwakely/gcc/7.1.0 --enable-libstdcxx-debug --disable-bootstrap
--disable-liboffloadmic --disable-libmpx --disable-libhsail-rt --without-isl
--enable-languages=c,c++
Thread model: posix
gcc version 7.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/jwakely/gcc/7.1.0/libexec/gcc/x86_64-pc-linux-gnu/7.1.0/cc1plus -quiet
-v -D_GNU_SOURCE np.cc -quiet -dumpbase np.cc -mtune=generic -march=x86-64
-auxbase np -version -o /tmp/ccp7MnOW.s
GNU C++14 (GCC) version 7.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 6.3.1 20161221 (Red Hat 6.3.1-1), GMP version
6.1.1, MPFR version 3.1.5, MPC version 1.0.2, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../include/c++/7.1.0

/home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../include/c++/7.1.0/x86_64-pc-linux-gnu

/home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../include/c++/7.1.0/backward
 /home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include
 /usr/local/include
 /home/jwakely/gcc/7.1.0/include
 /home/jwakely/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include-fixed
 /usr/include
End of search list.
GNU C++14 (GCC) version 7.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 6.3.1 20161221 (Red Hat 6.3.1-1), GMP version
6.1.1, MPFR version 3.1.5, MPC version 1.0.2, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9c4196dd7cfc6b28dfb404cfbddcbfa6
np.cc: In function ‘void problem(T&)’:
np.cc:16:6: error: result of ‘operator->()’ yields non-pointer result
 t->i;
  ^~

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #5 from bartek 'basz' szurgot  ---
Created attachment 41626
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41626=edit
gcc 6.3 vs gcc 7.1

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #4 from bartek 'basz' szurgot  ---
on my Debian it works on GCC 7.1.0, but not on GCC 6.3.0 (test script
attached):


+ g++-6 -v
Using built-in specs.
COLLECT_GCC=g++-6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18'
--with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--with-target-system-zlib --enable-objc-gc=auto --enable-multiarch
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170516 (Debian 6.3.0-18)
+ g++-6 -c reduced.cpp
reduced.cpp: In function ‘void problem(T&)’:
reduced.cpp:16:6: error: result of ‘operator->()’ yields non-pointer result
 t->i;
  ^~
+ echo 1
1
+ g++-7 -v
Using built-in specs.
COLLECT_GCC=g++-7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.1.0-7'
--with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.1.0 (Debian 7.1.0-7)
+ g++-7 -c reduced.cpp
+ echo 0
0

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #3 from Jonathan Wakely  ---
(In reply to bartek 'basz' szurgot from comment #2)
> looks like the problem is gone in GCC-7.1.

No, doesn't seem to be.

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-23 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #2 from bartek 'basz' szurgot  ---
looks like the problem is gone in GCC-7.1.

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

--- Comment #1 from Jonathan Wakely  ---
Reduced:

struct S
{
  int i;
};

template
struct T
{
auto operator->() { return  }
S s;
};

template
void problem(T& t)
{
t->i;
}

[Bug c++/81182] result of ‘operator->()’ yields non-pointer result

2017-06-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81182

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-23
 Ever confirmed|0   |1