public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h
       [not found] <bug-67256-4@http.gcc.gnu.org/bugzilla/>
@ 2015-08-18 12:27 ` redi at gcc dot gnu.org
  2015-08-18 12:27 ` [Bug c++/67256] " redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-08-18 12:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67256

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++
           Severity|major                       |normal


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h
       [not found] <bug-67256-4@http.gcc.gnu.org/bugzilla/>
  2015-08-18 12:27 ` [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h redi at gcc dot gnu.org
@ 2015-08-18 12:27 ` redi at gcc dot gnu.org
  2015-08-18 12:43 ` [Bug libstdc++/67256] " redi at gcc dot gnu.org
  2015-08-18 13:59 ` michal.fita at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-08-18 12:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67256

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
17.6.1.2 [headers] specifically says:

  It is unspecified whether these names are first declared within the global
  namespace scope and are then injected into namespace std by explicit using-
  declarations.

A conforming implementation can define ::log and ::sin when any standard header
is included, and so your code will never be portable if you reuse those names
for namespaces.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h
       [not found] <bug-67256-4@http.gcc.gnu.org/bugzilla/>
  2015-08-18 12:27 ` [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h redi at gcc dot gnu.org
  2015-08-18 12:27 ` [Bug c++/67256] " redi at gcc dot gnu.org
@ 2015-08-18 12:43 ` redi at gcc dot gnu.org
  2015-08-18 13:59 ` michal.fita at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-08-18 12:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67256

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
N.B. the functions happen to be declared in <bits/mathcalls.h> but they are
standard functions declared in <math.h> and so your code would already have
failed to compile in C++03 if anyone included <math.h> (and the same applies
for <cmath> when that is implemented in terms of <math.h>, which is permitted
by the text I quoted from the standard).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h
       [not found] <bug-67256-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-08-18 12:43 ` [Bug libstdc++/67256] " redi at gcc dot gnu.org
@ 2015-08-18 13:59 ` michal.fita at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: michal.fita at gmail dot com @ 2015-08-18 13:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67256

--- Comment #3 from Michał Fita <michal.fita at gmail dot com> ---
Contrary to my expectations #include <cmath> doesn't work either. I would
expect these not declared in global if standard says unspecified, as my logic
whisper that would be more C++ way. I understand then I shouldn't expect to get
this fixed as removing these symbols from global scope would break existing
code?

Interesting thing about declaration in mathcalls.h is that they're surrounded
by _Mdouble_BEGIN_NAMESPACE and _Mdouble_END_NAMESPACE macros, which seem empty
when included from cmath (to my surprise that one redefines all functions in
std on top of what is in math.h). Whether these are empty or not the presence
of _GLIBCPP_USE_NAMESPACES decides.

Now I see it has been mindfully done with purpose: 
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6257
- http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#456

Another point to the C++ list on the side "hate".
>From gcc-bugs-return-495090-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Aug 18 14:28:32 2015
Return-Path: <gcc-bugs-return-495090-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 125437 invoked by alias); 18 Aug 2015 14:28:31 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 122796 invoked by uid 55); 18 Aug 2015 14:28:22 -0000
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/67028] combine bug. Different assumptions about subreg in different places.
Date: Tue, 18 Aug 2015 14:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: segher at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: segher at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67028-4-pTbYwhcM5J@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67028-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67028-4@http.gcc.gnu.org/bugzilla/>
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-08/txt/msg01232.txt.bz2
Content-length: 732

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg028

--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Tue Aug 18 14:27:50 2015
New Revision: 226971

URL: https://gcc.gnu.org/viewcvs?rev"6971&root=gcc&view=rev
Log:
        PR rtl-optimization/67028
        * combine.c (simplify_comparison): Fix comment.  Rearrange code.
        Add test to see if a const_int fits in the new mode.

gcc/testsuite/
        PR rtl-optimization/67028
        * gcc.dg/pr67028.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr67028.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/combine.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-18 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-67256-4@http.gcc.gnu.org/bugzilla/>
2015-08-18 12:27 ` [Bug libstdc++/67256] [C++11] Global scope contaminated with symbols from mathcalls.h redi at gcc dot gnu.org
2015-08-18 12:27 ` [Bug c++/67256] " redi at gcc dot gnu.org
2015-08-18 12:43 ` [Bug libstdc++/67256] " redi at gcc dot gnu.org
2015-08-18 13:59 ` michal.fita at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).