From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18F193849AEA; Fri, 10 May 2024 13:34:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18F193849AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715348081; bh=En/KHJAlltTfOJMPLrqYLQcUy4p5Nwzw5VUzqSVGY6c=; h=From:To:Subject:Date:From; b=oU2HB8lNykdP3zOftgCCf2+0MDQm5sW6AJt7Empg56NI8IijHVckZTbj0hEzoZoI8 e2Qn+GhCD9amNmQveJcP58q3XibuRv6CqnDFiUC2YR+pbVuMbTAaf5JCB9xtGn2Cjq oyLwFYzBdIbdr3JpbbMrH9gp8JA0+1cifvCGDRaw= From: "sska1377 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115030] New: Constrained auto variable declaration with partial specialization Date: Fri, 10 May 2024 13:34:40 +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: 14.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sska1377 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115030 Bug ID: 115030 Summary: Constrained auto variable declaration with partial specialization Product: gcc Version: 14.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sska1377 at gmail dot com Target Milestone: --- Created attachment 58173 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58173&action=3Dedit the code This is a simple valid code that uses a constrained auto placeholder that is dependent on template parameters, in a partial specialization variable template. // report_1.cc template concept TheConcept =3D __is_same(T, U); template struct A { }; template char v =3D 'a'; template TheConcept auto v> =3D 'c'; int main() { v>; return 0; } which fails with the following error: $ g++ report_1.cc --std=3Dc++20 report_1.cc: In instantiation of 'auto [requires ::TheConcept<, T>] v >': report_1.cc:15:3: required from here 15 | v>; | ^~~~~~~~~~ report_1.cc:12:30: error: deduced initializer does not satisfy placeholder constraints 12 | TheConcept auto v> =3D 'c'; | ^~~ report_1.cc:12:30: note: constraints not satisfied report_1.cc:2:9: required for the satisfaction of 'TheConcept, T>], T>' [with auto [requires ::TheConcept<, T>] =3D char; T =3D A] report_1.cc:2:22: note: 'char' is not the same as 'A' 2 | concept TheConcept =3D __is_same(T, U); | ^~~~~~~~~~~~~~~ This has been tested using: $ g++ -v Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=3D/usr --libdir=3D/usr/lib --libexecdir=3D/usr/= lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttps://gitlab.archlinux.org/archlinux/packaging/packages/g= cc/-/issues --with-build-config=3Dbootstrap-lto --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-obj= ect --enable-libstdcxx-backtrace --enable-link-serialization=3D1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdc= xx-pch --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.1.1 20240507 (GCC)=