From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113163 invoked by alias); 25 Feb 2015 08:43:00 -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 113118 invoked by uid 48); 25 Feb 2015 08:42:56 -0000 From: "simendsjo at simendsjo dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64842] Implicitly defined constructor isn't constexpr Date: Wed, 25 Feb 2015 09:52: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: simendsjo at simendsjo dot me X-Bugzilla-Status: RESOLVED 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: Message-ID: In-Reply-To: References: 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-02/txt/msg02743.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64842 --- Comment #2 from simendsjo at simendsjo dot me --- (In reply to Ville Voutilainen from comment #1) > The constructors for Point are constexpr, but since p2 is not, passing > it as an argument for scale() means that the invocation of scale() will not > yield a constant expression. If you change the declaration of p2 to > be > constexpr Point p2 {10,10}; > the code will work. Clang agrees with gcc. Then there are a couple of possibilities: 1. The spec is wrong 2. Bjarne Stroustrup misinterprets the spec 3. gcc and clang has the same bug You're saying that 2. holds. In that case, send a mail to Stroustrup so he can correct his book "Programming: Principles and Practice using C++".