public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "unmobile at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66439] New: Diagnostic on failed function template lookup is missing a line Date: Sat, 06 Jun 2015 06:19:00 -0000 [thread overview] Message-ID: <bug-66439-4@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4495 bytes --] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66439 Bug ID: 66439 Summary: Diagnostic on failed function template lookup is missing a line Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: unmobile at gmail dot com Target Milestone: --- Created attachment 35705 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35705&action=edit Test input When compiling the attached code, I get a pretty messed-up diagnostic that is both less than fully informative and suggests there's supposed to be more output, but doesn't print any: > $ g++-5 -c adltest.cpp > adltest.cpp: In function âvoid g(A::B)â: > adltest.cpp:11:12: error: no matching function for call to âf(A::B&)â > C::f<3>(b); //ill-formed; argument dependent lookup > ^ > adltest.cpp:6:26: note: candidate: template<class T> void C::f(T) > template<class T> void f(T t); > ^ > adltest.cpp:6:26: note: template argument deduction/substitution failed: (note the trailing colon ':' on the last line) This came to light when I tried to compile the code from http://stackoverflow.com/questions/2953684/why-doesnt-adl-find-function-templates and saw this trailed-off report. Really, the diagnostic should report more explicitly what's going on, that C::f isn't a valid binding because the template parameter '3' doesn't match up with the class parameter C::f expects. >From gcc-bugs-return-488228-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jun 06 06:26:40 2015 Return-Path: <gcc-bugs-return-488228-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 67340 invoked by alias); 6 Jun 2015 06:26:39 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 66011 invoked by uid 48); 6 Jun 2015 06:26:36 -0000 From: "unmobile at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66440] New: Diagnostic on "'foo' was not declared in this scope" offers an invalid suggestion Date: Sat, 06 Jun 2015 06:26:00 -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: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: unmobile 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: <bug-66440-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg00560.txt.bz2 Content-length: 978 https://gcc.gnu.org/bugzilla/show_bug.cgi?idf440 Bug ID: 66440 Summary: Diagnostic on "'foo' was not declared in this scope" offers an invalid suggestion Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: unmobile at gmail dot com Target Milestone: --- Created attachment 35706 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5706&actioníit Test input When I try to compile the attached source with g++ 5.1.1, I get a suggestion to use C::f. However, an explicit qualified call to C::f with the given template and function arguments would be invalid, as shown in the later statement. Perhaps the compiler should evaluate the candidates before enumerating them for the user, and either drop them or distinguish that they wouldn't actually match?
next reply other threads:[~2015-06-06 6:19 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-06-06 6:19 unmobile at gmail dot com [this message] 2015-06-06 6:30 ` [Bug c++/66439] " unmobile at gmail dot com 2020-05-09 18:18 ` ppalka at gcc dot gnu.org 2020-05-19 3:52 ` cvs-commit at gcc dot gnu.org 2020-05-19 12:32 ` ppalka at gcc dot gnu.org 2021-08-09 22:01 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-66439-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).