From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28359 invoked by alias); 22 Jul 2011 11:08:19 -0000 Received: (qmail 28348 invoked by uid 22791); 22 Jul 2011 11:08:18 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jul 2011 11:08:03 +0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49813] [C++0x] sinh vs asinh vs constexpr X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch 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: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 22 Jul 2011 11:08: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 X-SW-Source: 2011-07/txt/msg01829.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49813 --- Comment #8 from vincenzo Innocente 2011-07-22 11:06:41 UTC --- what about other "new C99 functions" such as cexprMath.cpp:16:64: error: 'float std::nextafter(float, float)' is not 'constexpr' cexprMath.cpp:17:58: error: 'float std::trunc(float)' is not 'constexpr' cexprMath.cpp:18:48: error: 'float std::lgamma(float)' is not 'constexpr' cexprMath.cpp:19:46: error: 'float std::erfc(float)' is not 'constexpr' ? have not tested all (yet). from #include struct foo { static constexpr float a = std::cos(3.); static constexpr float c = std::exp(3.); static constexpr float d = std::log(3.); static constexpr float e1 = std::asin(1.); static constexpr float h = std::sqrt(.1); static constexpr float p = std::pow(1.3,-0.75); static constexpr float es = std::sinh(1.); static constexpr float ec = std::cosh(1.); static constexpr float et = std::tanh(1.); static constexpr float zs = std::asinh(1.2); static constexpr float zc = std::acosh(1.2); static constexpr float zt = std::atanh(.5); static constexpr float pi1 =std::nextafter(std::cos(-1.f),0.f); static constexpr float three =std::trunc(std::cos(-1.f)); static constexpr float l0 = std::lgamma(0.45f); static constexpr float er = std::erfc(0.45f); }; as we are on the subject: if the argument of the function is invalid such as static constexpr float nan1 = std::asin(1.45f); static constexpr float nan2 = std::sqrt(-1.45f); I get exactly the same error as above which is a bit confusing cexprMath.cpp:20:48: error: call to non-constexpr function 'float std::asin(float)' cexprMath.cpp:20:48: error: field initializer is not constant cexprMath.cpp:21:49: error: call to non-constexpr function 'float std::sqrt(float)' cexprMath.cpp:21:49: error: field initializer is not constant (the test of the message has changed between 4.6 and 4.7)