From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 472463858D35; Thu, 4 Nov 2021 14:30:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 472463858D35 From: "terra at gnome dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103081] New: [ICE] with "using enum" Date: Thu, 04 Nov 2021 14:30:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: terra at gnome dot org 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 14:30:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103081 Bug ID: 103081 Summary: [ICE] with "using enum" Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: terra at gnome dot org Target Milestone: --- This code triggers an internal compiler error. ------------------------------------------------ enum class Pig { OINK }; struct Hog { using enum Pig; Hog(Pig) { } }; template void pen() { (void)Hog(Hog::OINK); } void pen() { pen<0>(); } ------------------------------------------------ .../gcc/11.1.0/bin/g++ -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE64_SOURCE -pedantic-errors -Wall -Wno-unknown-pragmas -W -fsigned-char -malign-data= =3Dabi -fno-semantic-interposition -gz=3Dzlib-gnu -c -march=3Dwestmere -mmmx -mno-= 3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-sgx -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx5= 12er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param "l1-cache-size=3D32" --param "l1-cache-line-size=3D64" --param "l2-cache-size=3D12288" -mtune=3Dwestmere -std=3Dgnu++20 -Wrestrict -Wdangling-else -Wno-placement-new -Wno-deprecated-declarations -fno-strict-overflow -Wzero-as-null-pointer-constant -Wwrite-strings -Wno-ignored-qualifiers -Wno-array-bounds -Wno-mismatched-new-delete -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -m32 -mfpmath=3Dsse -Woverloaded-vi= rtual -fPIC -g -o /home/welinder/using-enum_L111a3.o /home/welinder/using-enum.C /home/welinder/using-enum.C: In instantiation of =E2=80=98void pen() [with = unsigned int =3D 0]=E2=80=99: /home/welinder/using-enum.C:14:9: required from here /home/welinder/using-enum.C:10:18: internal compiler error: in tsubst_copy,= at cp/pt.c:16715 10 | (void)Hog(Hog::OINK); | ~~~~~^~~~ 0x669a60 tsubst_copy ../../../gcc-11.1.0/gcc/cp/pt.c:16715 0x802d0c tsubst_qualified_id ../../../gcc-11.1.0/gcc/cp/pt.c:16449 0x8041b6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19948 0x814e01 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19587 0x814e01 tsubst_tree_list(tree_node*, tree_node*, int, tree_node*) ../../../gcc-11.1.0/gcc/cp/pt.c:15417 0x8037fa tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:20586 0x804f67 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19587 0x804f67 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19797 0x814e01 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19587 0x814e01 tsubst_tree_list(tree_node*, tree_node*, int, tree_node*) ../../../gcc-11.1.0/gcc/cp/pt.c:15417 0x8037fa tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:20586 0x804f67 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19587 0x804f67 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19797 0x815114 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19587 0x815114 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:19198 0x816181 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:18223 0x816181 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:18268 0x815c4f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:18223 0x815c4f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:18589 0x809719 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../../gcc-11.1.0/gcc/cp/pt.c:25909 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Return code for compiling using-enum.C: 1 This is an x86_64 system running OpenSuSE 15.2.=