[Bug c++/85848] New: Incorrect handling of explicit casting to move-only types

2018-05-20 Thread kot.tom97 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85848

Bug ID: 85848
   Summary: Incorrect handling of explicit casting to move-only
types
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kot.tom97 at gmail dot com
  Target Milestone: ---

See
https://stackoverflow.com/questions/50430149/clang-vs-gcc-when-static-casting-to-a-move-only-type.

[Bug c++/85848] Incorrect handling of explicit casting to move-only types

2018-05-20 Thread kot.tom97 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85848

--- Comment #2 from Tom Westerhout  ---
Created attachment 44152
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44152&action=edit
Sample code triggering the error

[Bug c++/85848] Incorrect handling of explicit casting to move-only types

2018-05-20 Thread kot.tom97 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85848

--- Comment #3 from Tom Westerhout  ---
Created attachment 44153
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44153&action=edit
Preprocessed source

Result after preprocessing test.cpp

[Bug c++/85848] Incorrect handling of explicit casting to move-only types

2018-05-20 Thread kot.tom97 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85848

--- Comment #4 from Tom Westerhout  ---
A few configurations on which the attached example fails to compile:

$ 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.4.0-12'
--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.4.0 20180123 (Debian 6.4.0-12) 

$ 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.3.0-18'
--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.3.0 (Debian 7.3.0-18) 

$ g++-8 -v
Using built-in specs.
COLLECT_GCC=g++-8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.1.0-3'
--with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-8
--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 8.1.0 (Debian 8.1.0-3) 


All three versions produce the following error message:

test.cpp: In function ‘int main()’:
test.cpp:13:29: error: invalid static_cast from type ‘box’ to type ‘bar&&’
 static_cast(box{});

The exact build command used:

g++ -std=c++14 -Wall -Wextra -pedantic test.cpp

@Jonathan Wakely, does this qualify as a valid bug report now? or should I add
something else?

[Bug c++/71504] bogus error: accessing value through a glvalue in a constant expression

2017-07-14 Thread kot.tom97 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71504

Tom Westerhout  changed:

   What|Removed |Added

 CC||kot.tom97 at gmail dot com

--- Comment #2 from Tom Westerhout  ---
Hi!


I'm working on a library that does a lot of work inside constexpr
functions. In simple cases like the example above it's relatively easy
to avoid this bug. In real life, however, it's almost impossible.

Although this bug is not considered important, it it important for
me. Currently, it is the only reason my library doesn't work with GCC.
I'd really appreciate it if this bug was assigned to someone. If there
are no volunteers, I'd be happy to help myself. Unfortunately, I'm not
familiar with GCC's code base at all. So some pointers to where I can
get started would be very helpful.


Tom