[Bug c++/112838] Compiler is unable to show the exact error location when calling copy ctor for a non-copyable object

eng.ahmad.nour at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 5 08:57:27 GMT 2023


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

--- Comment #6 from Ahmad Nour <eng.ahmad.nour at gmail dot com> ---
(In reply to Jonathan Wakely from comment #5)
> (In reply to Ahmad Nour from comment #2)
> > I tried with clang-12 -Wall -Wextra main.cpp, but I didn't get that
> > hint/note. Am I missing something?
> 
> You should get that note with clang-12 (and newer versions)
> https://godbolt.org/z/KM65MKrPa

Thanks, but I also don't see it in godbolt output.
Note: I'm referring to this exact note:

> <source>:14:18: note: in implicit copy constructor for 'NonCopyable' first required here
>    14 |         NonCopyable b(a);

I can't find anything related to line #13: NonCopyable b(a); which is the root
cause of the issue


More information about the Gcc-bugs mailing list