From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5366 invoked by alias); 13 May 2015 13:27:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 130924 invoked by uid 48); 13 May 2015 13:26:58 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66130] "invalid use of non-static member function" message could be clearer Date: Wed, 13 May 2015 13:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: easyhack X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: attachments.created Message-ID: In-Reply-To: References: 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-SW-Source: 2015-05/txt/msg01058.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66130 --- Comment #2 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- Created attachment 35537 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D35537&action=3Dedit non-working patch This patch fails for: struct Local { void f(); }; Local *l; void (Local::*ptr)(); decltype((l->*ptr)) i; // { dg-error "member function" } /home/manuel/test1/src/gcc/testsuite/g++.dg/cpp0x/decltype31.C:11:19: error: invalid use of non-static member function '#'offset_ref' not supported by dump_decl# We don't want to use %qE, but I'm not sure how to extract a declaration fro= m an offset_ref.=20 (It would be great to make such things an ICE with enable-checking, the pat= ch passes bootstrap+regression tests!) >>From gcc-bugs-return-486219-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed May 13 13:56:30 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 71506 invoked by alias); 13 May 2015 13:56:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 69299 invoked by uid 48); 13 May 2015 13:56:26 -0000 From: "barry.revzin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66135] New: trailing return type generic lambda Date: Wed, 13 May 2015 13:56: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: barry.revzin 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 Message-ID: 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-05/txt/msg01059.txt.bz2 Content-length: 1067 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66135 Bug ID: 66135 Summary: trailing return type generic lambda Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this attempt at implementing fmap for optionals in C++: #include #include template auto fmap(Func f) { return [=](auto arg) -> boost::optional { // ** if (arg) { return f(*arg); } else { return boost::none; } }; } int main() { auto id = fmap([](int i){ return i; }); auto res = id(boost::optional{42}); std::cout << *res << std::endl; } This code compiles in clang 3.6, but on gcc 5.1 issues an error on the indicated line: error: invalid type argument of unary '*' (have 'auto:1')