From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AA823858C2B; Wed, 9 Nov 2022 00:30:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AA823858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667953814; bh=eJAmgXQXve4JjSichmy6uSSBOx/jtue5DSxGZZQuH+Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OTjp3QvpuxhDlyNyec/NaBwAHsoW9iMOxDHYJWnAuc5xjmtuTDqpU6xtcuzUDitER TxE7L5Qhv2B5fcTq19VgeiHS1KidQyWYdALkQkwST51g91KmQpuyTAard+LPGfqxmU 6OseE5Vo3Cc4K/OzS1OmjKo5qy/C3HOFo581QBb0= From: "viktor.shepel.public at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107584] internal compiler error: in finish_member_declaration, at cp/semantics.c:3023 Date: Wed, 09 Nov 2022 00:30:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: viktor.shepel.public at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107584 --- Comment #1 from Viktor Shepel -= -- Hi Required items are below. #1. exact version of GCC 7.5.0 #2. system type $lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic #3. options given when GCC was configured/built $g++ -v Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=3Dfile:///usr/share/doc/gcc-7/README.Bu= gs --enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=3D/u= sr --with-gcc-major-version-only --program-suffix=3D-7 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-bootstrap --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linu= x-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)=20 #4. complete command line that triggers the bug g++ -std=3Dc++17 issue.cpp #5. compiler output In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/nested_exception.h:40, from /usr/include/c++/7/exception:143, from /usr/include/c++/7/ios:39, from /usr/include/c++/7/ostream:38, from /usr/include/c++/7/iostream:39, from issue.cpp:1: /usr/include/c++/7/type_traits: In instantiation of =E2=80=98struct std::__detector > >=E2=80=99: /usr/include/c++/7/experimental/type_traits:242:71: required by substitut= ion of =E2=80=98template class _Op, class ... _Args> using = is_detected =3D typename std::__detector::value_t [with _Op =3D formatted_input_t; _Args =3D {std::vector >}]=E2=80=99 issue.cpp:12:16: required from =E2=80=98constexpr const bool is_ostreamable_v >=E2=80=99 issue.cpp:30:5: required from here /usr/include/c++/7/type_traits:2512:5: internal compiler error: in finish_member_declaration, at cp/semantics.c:3023 { ^ #6. preprocessed file file `issue.ii` in attachment Additional info: #1. Versions 8.4.0, 9.4.0, 10.3.0 and 11.1.0 produce error rather crash In file included from issue.cpp:4: /usr/include/c++/11/experimental/type_traits: In substitution of =E2=80=98template class _Op, class ... _Args> using is_= detected =3D typename std::__detector::value_t [with _Op =3D formatted_input_t; _Args =3D {std::vector >}]=E2=80=99: issue.cpp:19:66: required from =E2=80=98constexpr bool is_ostreamable() [= with T =3D std::vector]=E2=80=99 issue.cpp:24:39: required by substitution of =E2=80=98template(), bool>::type > std::ostream& operator<<(std::ostream&, const T&) [with T =3D std::vector; typename std::enable_if(), bool>::type =3D ]= =E2=80=99 /usr/include/c++/11/experimental/type_traits:245:9: recursively required = by substitution of =E2=80=98template class= _Op, class ... _Args> struct std::__detector<_Default, std::__void_t<_Op<_Args ...> >, _Op, _Args ...> [with _Default =3D std::experimental::fundamentals_v2::none= such; _Op =3D formatted_input_t; _Args =3D {std::vector = >}]=E2=80=99 /usr/include/c++/11/experimental/type_traits:245:9: required by substitut= ion of =E2=80=98template class _Op, class ... _Args> using = is_detected =3D typename std::__detector::value_t [with _Op =3D formatted_input_t; _Args =3D {std::vector >}]=E2=80=99 issue.cpp:15:4: required from =E2=80=98constexpr const bool is_ostreamable_v >=E2=80=99 issue.cpp:30:5: required from here /usr/include/c++/11/experimental/type_traits:245:9: error: invalid use of incomplete type =E2=80=98struct std::__detector > >=E2=80=99 245 | using is_detected | ^~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/nested_exception.h:40, from /usr/include/c++/11/exception:148, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from issue.cpp:1: /usr/include/c++/11/type_traits:2542:12: note: declaration of =E2=80=98stru= ct std::__detector > >=E2=80=99 2542 | struct __detector | ^~~~~~~~~~ #2. CVISE reduced testcase #include #include #include template using formatted_input_t =3D decltype(std::declval() << std::declval()); template bool is_ostreamable_v =3D std::experimental::is_detected::value; template constexpr bool is_ostreamable() { return std::experimental::is_detected::value; } template ()> =3D true> std::ostream operator<<(std::ostream, T); int main() { using T =3D std::vector; is_ostreamable_v; }=