From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75CCB3888038; Thu, 24 Jun 2021 13:43:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75CCB3888038 From: "yannick.lepennec+gcc at live dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101194] New: 7.2 Regression Date: Thu, 24 Jun 2021 13:43:20 +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: 7.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yannick.lepennec+gcc at live dot fr 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, 24 Jun 2021 13:43:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101194 Bug ID: 101194 Summary: 7.2 Regression Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yannick.lepennec+gcc at live dot fr Target Milestone: --- Dear Maintainers, Obligatory godbolt: https://godbolt.org/z/KnMnc7P57 Since GCC 7.2: $ g++ -std=3Dc++17 -Wall -Wextra -pedantic-errors #include struct nodefault { nodefault(int) {} }; int main() { std::array arr1{ nodefault{1} }; // OK std::array arr2{ arr1[0] }; // Error??? } Gives: main.cpp: In function 'int main()': main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:9:44: error: no matching function for call to 'nodefault::nodefaul= t()' std::array arr2{ arr1[0] }; // Error??? ^ main.cpp:4:5: note: candidate: nodefault::nodefault(int) nodefault(int) {} ^~~~~~~~~ main.cpp:4:5: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(const nodefau= lt&) struct nodefault { ^~~~~~~~~ main.cpp:3:8: note: candidate expects 1 argument, 0 provided main.cpp:3:8: note: candidate: constexpr nodefault::nodefault(nodefault&&) main.cpp:3:8: note: candidate expects 1 argument, 0 provided --- GCC 7.2 and above accept the same code with -std=3Dc++14. GCC 7.1 accepts i= t with either. The error message seems to have gotten shorter in more recent GCC, = but is still present. I have bisected this to https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommitdiff;h=3D0634d9fe36e8ced1c60= 46759f9ce1d2655c8d731=