Patchwork [v3] fix libstdc++/47662

login
register
mail settings
Submitter Jonathan Wakely
Date Feb. 10, 2011, 10:40 p.m.
Message ID <AANLkTinuYb6K70WegBRhUnkpyQYAshCfNbCpKaRsH1cA@mail.gmail.com>
Download mbox | patch
Permalink /patch/82679/
State New
Headers show

Comments

Jonathan Wakely - Feb. 10, 2011, 10:40 p.m.
2011-02-10  Jonathan Wakely  <jwakely.gcc@gmail.com>

        PR libstdc++/47662
        * include/bits/c++config: Do not use alternative token.
        * testsuite/17_intro/headers/c++1998/operator_names.cc: New.

There should be a new test for C++0x mode too, but there's another bug
that needs fixing first.

Tested x86_64-linux, committed to trunk.

Patch

Index: include/bits/c++config
===================================================================
--- include/bits/c++config	(revision 169994)
+++ include/bits/c++config	(working copy)
@@ -263,7 +263,7 @@  namespace std
 // _GLIBCXX_END_NAMESPACE_ALGO
 // _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 // _GLIBCXX_END_NAMESPACE_CONTAINER
-#if defined(_GLIBCXX_DEBUG) or defined(_GLIBCXX_PROFILE)
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
 # define _GLIBCXX_STD_C __cxx1998
 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
 	 namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION
Index: testsuite/17_intro/headers/c++1998/operator_names.cc
===================================================================
--- testsuite/17_intro/headers/c++1998/operator_names.cc	(revision 0)
+++ testsuite/17_intro/headers/c++1998/operator_names.cc	(revision 0)
@@ -0,0 +1,28 @@ 
+// { dg-do compile }
+// { dg-options "-fno-operator-names" }
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// Avoid using PCH
+#include <cerrno>
+#include <bits/stdc++.h>
+#include <bits/stdtr1c++.h>
+#include <bits/extc++.h>
+
+int or, xor, and;
+