public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106584] New: g++ not showing correct line number in "use of deleted function" error
@ 2022-08-11 15:14 accelerator0099 at gmail dot com
  2022-08-11 15:15 ` [Bug c++/106584] " accelerator0099 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: accelerator0099 at gmail dot com @ 2022-08-11 15:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106584

            Bug ID: 106584
           Summary: g++ not showing correct line number in "use of deleted
                    function" error
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: accelerator0099 at gmail dot com
  Target Milestone: ---

Example code:
----------------------------------------------------
#include <map>
#include <memory>

using int_map = std::map<int, std::unique_ptr<int>>;

void f(int_map cl);

void f2() {
    int_map cl;
    f(cl);
}
----------------------------------------------------

The actual error is that int_map is not copiable, so line 10 is ill-formed
But the compiler doesn't tell you anything about line 10, it just prints tons
of waste

This is unreasonable. You may make such a careless mistake (missing a '&') in
thousands of lines, the compiler should locate where the error is for you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-12  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 15:14 [Bug c++/106584] New: g++ not showing correct line number in "use of deleted function" error accelerator0099 at gmail dot com
2022-08-11 15:15 ` [Bug c++/106584] " accelerator0099 at gmail dot com
2022-08-11 15:16 ` accelerator0099 at gmail dot com
2022-08-11 15:42 ` pinskia at gcc dot gnu.org
2022-08-11 15:43 ` pinskia at gcc dot gnu.org
2022-08-12  6:52 ` accelerator0099 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).