[Bug c++/80412] New: [c++17] crash with class template deduction guide and inheritance
h2+bugs at fsfe dot org
gcc-bugzilla@gcc.gnu.org
Wed Apr 12 11:23:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80412
Bug ID: 80412
Summary: [c++17] crash with class template deduction guide and
inheritance
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: h2+bugs at fsfe dot org
Target Milestone: ---
Created attachment 41188
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41188&action=edit
intermediate file
% uname -a
FreeBSD <SNIP> 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29
01:43:23 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC
amd64
% g++7 --version
g++7 (FreeBSD Ports Collection) 7.0.1 20170402 (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.
I have a class template that has a user defined type deduction guide and
another class template that inherits from the first (and doesn't have its own
guide).
If I try to instantiate an object of the derived class without <>, i.e.
triggering type deduction, I first get an error that type deduction failed and
then a crash:
/home/mi/h4nn3s/devel/seqan3/test/alphabet/quality/composition_test.cpp:187:50:
error: class template argument deduction failed:
quality_composition t0{dna4::C, illumina18{7}};
^
/home/mi/h4nn3s/devel/seqan3/test/alphabet/quality/composition_test.cpp:187:50:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
I have attached the zipped .ii
Adding a manual deduction guide for the derived class template fixes the
problem. I am not sure what the expected behaviour is, i.e. whether guides
should be inherited -- if possible -- or not, but I thought I would report the
crash in any case.
Note that I use -fconcepts, but I think it is unrelated.
More information about the Gcc-bugs
mailing list