[Bug c++/53157] within lambda, error: lvalue required as unary ‘&’ operand

2017-07-03 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53157

bartek 'basz' szurgot  changed:

   What|Removed |Added

 CC||gcc at baszerr dot eu

--- Comment #4 from bartek 'basz' szurgot  ---
issue still present in GCC 7.1.0.

[Bug c++/58894] C++11 lambda doesn't take const variable by reference

2017-07-03 Thread gcc at baszerr dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58894

bartek 'basz' szurgot  changed:

   What|Removed |Added

 CC||gcc at baszerr dot eu

--- Comment #2 from bartek 'basz' szurgot  ---
looks like a duplicate of 53157
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53157).

[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 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-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] New: result of ‘operator->()’ yields non-pointer result

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

Bug ID: 81182
   Summary: result of ‘operator->()’ yields non-pointer result
   Product: gcc
   Version: 6.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at baszerr dot eu
  Target Milestone: ---

Created attachment 41615
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41615=edit
minimal (not) working example

it looks like arrow operator does not work correctly, when it is part of a
template class, called from a template function, and return type is "auto". it
does not compile, while the code is fine. it also works fine on Clang.

$ g++ -Wall arrow_operator.cpp
arrow_operator.cpp: In function ‘void problem()’:
arrow_operator.cpp:24:7: error: result of ‘operator->()’ yields non-pointer
result
 op->doNothing();

test code reproducing a bug (attached) provides two macros, that define a
workaround for the issue: return "auto*" or make calling function ("problem()")
not a template.

i've also noticed, that defining a non-template function, with the same content
as "templated" one, but under a different name, does make the problem disappear
as well... but only if the function is before the template - not when it is
after.