From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31007 invoked by alias); 11 Jan 2013 14:43:07 -0000 Received: (qmail 29670 invoked by uid 48); 11 Jan 2013 14:42:44 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55942] New: [C++11] sorry, unimplemented: calling a member function of the object being constructed in a constant expression Date: Fri, 11 Jan 2013 14:43: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-Keywords: FIXME X-Bugzilla-Severity: minor X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-01/txt/msg01029.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55942 Bug #: 55942 Summary: [C++11] sorry, unimplemented: calling a member function of the object being constructed in a constant expression Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: FIXME Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: redi@gcc.gnu.org struct A { constexpr explicit A(bool b) : o{flip(b)} { } constexpr bool flip(bool b) { return !b; } bool o; }; ce.cc: In constructor 'constexpr A::A(bool)': ce.cc:3:49: sorry, unimplemented: calling a member function of the object being constructed in a constant expression constexpr explicit A(bool b) : o{flip(b)} { } ^ I found this by accident because I meant to define A::flip as a static member function, which would have worked. Omitting the static gives the "sorry" above.