[Bug c++/70844] New: spurious -Wuseless-cast warning with inherited constructors

2016-04-28 Thread danny+gcc at nerdcruft dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70844

Bug ID: 70844
   Summary: spurious -Wuseless-cast warning with inherited
constructors
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danny+gcc at nerdcruft dot net
  Target Milestone: ---

Created attachment 38359
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38359&action=edit
useless-cast inherited constructor test case

When using -Wuseless-cast with C++11 code under gcc-6.1.0 an inherited
constructor will trigger useless-cast warnings on synthesized constructors
(with at least arithmetic types) even if the parameters are of the correct
type.

Attached a reduced test case.

Behaviour can be triggered as follows, with example output:
danny@steve /tmp $ g++ -std=c++11 -Wuseless-cast -c -o test.o test.cpp
test.cpp: In constructor ‘derived::derived(int)’:
test.cpp:6:17: warning: useless cast to type ‘int’ [-Wuseless-cast]
 using base::base;
 ^~~~
test.cpp: In function ‘void func(int)’:
test.cpp:11:17: note: synthesized method ‘derived::derived(int)’ first required
here 
 derived d (i);
 ^

This behaviour is observed in gcc-6.0.0 and gcc-6.1.0, but not gcc-5.3.0.

[Bug c++/81016] New: 7.1.0 ICE: segfault with template struct specialisation

2017-06-08 Thread danny+gcc at nerdcruft dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81016

Bug ID: 81016
   Summary: 7.1.0 ICE: segfault with template struct
specialisation
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danny+gcc at nerdcruft dot net
  Target Milestone: ---

Created attachment 41497
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41497&action=edit
reduced test case

When building the attached test case with:
g++-7.1.0 -std=c++17 test.ii

I encounter an internal compiler error, with output:
case0.ii:2:30: internal compiler error: Segmentation fault
 template  struct b;
  ^

My compiler version is as follows:
danny@sybil /tmp/reduce $ g++-7.1.0 -v
Using built-in specs.
COLLECT_GCC=g++-7.1.0
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/7.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-7.1.0-r1/work/gcc-7.1.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/7.1.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.1.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.1.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.1.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include/g++-v7
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/7.1.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 7.1.0-r1 p1.1' --disable-esp --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts
--disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --with-isl
--disable-isl-version-check --enable-libsanitizer --disable-default-pie
--disable-default-ssp
Thread model: posix
gcc version 7.1.0 (Gentoo 7.1.0-r1 p1.1)