From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D7D83858D39; Wed, 6 Jul 2022 12:33:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D7D83858D39 From: "henrik.nortamo at csc dot fi" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106214] New: Vector template argument deduction fails for templated function element Date: Wed, 06 Jul 2022 12:33:08 +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.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: henrik.nortamo at csc dot fi 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 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: Wed, 06 Jul 2022 12:33:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106214 Bug ID: 106214 Summary: Vector template argument deduction fails for templated function element Product: gcc Version: 11.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: henrik.nortamo at csc dot fi Target Milestone: --- Created attachment 53262 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53262&action=3Dedit full compiler error message The following code fails to compile with the command g++ -Wall -Wextra --std=3Dc++17 minimal.cpp minimal.cpp """ #include template=20 void foo() {}=20 int main(){ std::vector V{foo}; return 0; } """ The error emitted is (full error as an attachment ): """ minimal.cpp: In function =E2=80=98int main()=E2=80=99: minimal.cpp:7:29: error: class template argument deduction failed: std::vector V{foo}; ^ minimal.cpp:7:29: error: no matching function for call to =E2=80=98vector(<= unresolved overloaded function type>)=E2=80=99 In file included from /usr/include/c++/8/vector:64 """ Tested to fail in the same way for the following g++ versions: 7.4.0=20=20 8.3.0=20=20 8.5.0=20=20 9.1.0=20=20 9.4.0=20=20 11.2.0=20 11.3.0=20 Code compiles using Clang 13.0.0, icpc (ICC) 19.0.4 and=20 "Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0"=