From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28525 invoked by alias); 28 Jul 2012 10:27:00 -0000 Received: (qmail 28512 invoked by uid 22791); 28 Jul 2012 10:26:59 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Sat, 28 Jul 2012 10:26:43 +0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54112] including complex.h and complex fails in C++03 Date: Sat, 28 Jul 2012 10:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse 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: 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 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: 2012-07/txt/msg02065.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54112 --- Comment #2 from Marc Glisse 2012-07-28 10:26:42 UTC --- (In reply to comment #1) > Why it happens only in C++03 mode? Because the complex.h wrapper distributed with libstdc++ does: #ifdef __GXX_EXPERIMENTAL_CXX0X__ # include #else # if _GLIBCXX_HAVE_COMPLEX_H # include_next # endif #endif That's what I meant by "hijack", the system's complex.h can never be included in C++11. > I'm asking because if the issue isn't a > regression and we are sure that it doesn't happen in C++11 mode, I don't think > it can be considered high priority. I am not saying it is high priority (on the other hand, it is rather easy). Note that there are 2 issues (I should have been clearer): 1) we can't include both complex.h and complex in C++03 mode. The fix is trivial, #undef complex after the #include_next quoted above. The other headers all have a long list of #undef, that's just one more. 2) In C++11, there is no way to have cacos declared. A solution would be to move the _GLIBCXX_HAVE_COMPLEX_H block outside of the __GXX_EXPERIMENTAL_CXX0X__ condition.