From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31195 invoked by alias); 13 Jul 2014 08:49:26 -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 31031 invoked by uid 48); 13 Jul 2014 08:49:20 -0000 From: "kariya_mitsuru at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/61791] New: [C++11] [constexpr] Additional overloads of std::real should be a constexpr function Date: Sun, 13 Jul 2014 08:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kariya_mitsuru at hotmail dot com X-Bugzilla-Status: UNCONFIRMED 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 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: 2014-07/txt/msg00786.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61791 Bug ID: 61791 Summary: [C++11] [constexpr] Additional overloads of std::real should be a constexpr function Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: kariya_mitsuru at hotmail dot com I think that the sample code below should be compiled successfully. =========================================== #include static constexpr double d = std::real(10); int main() {} =========================================== Note that it is compiled successfully if the argument is std::complex(10) instead of 10. According to C++11 standard 26.4.9[cmplx.over] paragraph 2, "if either argument has type complex, double, or an integer type, then both arguments are effectively cast to complex." Therefore, I think it should be compiled successfully too.