From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BDC593939C3F; Fri, 12 Mar 2021 08:30:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDC593939C3F From: "jfhart085 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99558] New: wrong argument types reported for "no matching function" error message if ctor argument is a variable Date: Fri, 12 Mar 2021 08:30:21 +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: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jfhart085 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 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: Fri, 12 Mar 2021 08:30:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99558 Bug ID: 99558 Summary: wrong argument types reported for "no matching function" error message if ctor argument is a variable Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jfhart085 at gmail dot com Target Milestone: --- Created attachment 50371 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50371&action=3Dedit utl2.cc - demonstrates using deliberate error message from compile Wrong argument types are reported for "no matching function" error message = for a ctor if a ctor argument is a variable. The argument is reported as being a reference when it is not. An error message is deliberately generated to demonstrate the problem as follows: wrong argument type: variable used as argument, first argument is shown as "int &" but is actually "int" : $ g++ -c -o utl2.o utl2.cc utl2.cc: In function "int main()": utl2.cc:13:5: error: no matching function for call to "cls4::cls4(int&, int= )" correct argument type: constant used as argument, first argument is correct= ly shown as "int" $ g++ -D DBG1 -c -o utl2.o utl2.cc utl2.cc: In function "int main()": utl2.cc:13:5: error: no matching function for call to "cls4::cls4(int, int)" from gcc -v : Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapp= er Target: x86_64-pc-linux-gnu Configured with: /home/jhart/temp1/gcc-10.2.0/configure --prefix=3D/usr --disable-multilib --with-system-zlib --enable-languages=3Dc,c++,fortran Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC)=