aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-01-06 10:14:37 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-01-06 10:14:37 +0000
commit4192922c749ba0e0ca94b734ccabca8245520f9d (patch)
tree5b4732264587bf887f93ba3a063ef4e489db541e /libstdc++-v3/src
parent210dedfec3cf0dd04feab88b659d217b7d8c1079 (diff)
downloadgcc-4192922c749ba0e0ca94b734ccabca8245520f9d.zip
gcc-4192922c749ba0e0ca94b734ccabca8245520f9d.tar.gz
gcc-4192922c749ba0e0ca94b734ccabca8245520f9d.tar.bz2
re PR libstdc++/47185 (UB in TR1 and C++0x placeholders and non conforming implementation)
2011-01-06 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/47185 * src/placeholders.cc: New. * src/Makefile.am: Adjust. * src/Makefile.in: Regenerate. * include/std/functional (placeholders::_1, _2, ..., _29): Declare extern. * config/abi/pre/gnu.ver: Export. From-SVN: r168536
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/Makefile.am6
-rw-r--r--libstdc++-v3/src/Makefile.in15
-rw-r--r--libstdc++-v3/src/placeholders.cc65
3 files changed, 82 insertions, 4 deletions
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 28a924e..21a1bfd 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -207,6 +207,7 @@ sources = \
locale-inst.cc \
misc-inst.cc \
ostream-inst.cc \
+ placeholders.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@@ -354,6 +355,11 @@ debug.lo: debug.cc
debug.o: debug.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+placeholders.lo: placeholders.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+placeholders.o: placeholders.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
if GLIBCXX_LDBL_COMPAT
# Use special rules for compatibility-ldbl.cc compilation, as we need to
# pass -mlong-double-64.
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index c0d621d..6776eb7 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -109,10 +109,11 @@ am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
strstream.lo system_error.lo tree.lo allocator-inst.lo \
concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \
iostream-inst.lo istream-inst.lo istream.lo locale-inst.lo \
- misc-inst.lo ostream-inst.lo sstream-inst.lo streambuf-inst.lo \
- streambuf.lo string-inst.lo valarray-inst.lo wlocale-inst.lo \
- wstring-inst.lo mutex.lo condition_variable.lo chrono.lo \
- thread.lo future.lo $(am__objects_1) $(am__objects_4)
+ misc-inst.lo ostream-inst.lo placeholders.lo sstream-inst.lo \
+ streambuf-inst.lo streambuf.lo string-inst.lo valarray-inst.lo \
+ wlocale-inst.lo wstring-inst.lo mutex.lo condition_variable.lo \
+ chrono.lo thread.lo future.lo $(am__objects_1) \
+ $(am__objects_4)
am_libstdc___la_OBJECTS = $(am__objects_5)
libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -422,6 +423,7 @@ sources = \
locale-inst.cc \
misc-inst.cc \
ostream-inst.cc \
+ placeholders.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@@ -941,6 +943,11 @@ debug.lo: debug.cc
debug.o: debug.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
+placeholders.lo: placeholders.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+placeholders.o: placeholders.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
# Use special rules for compatibility-ldbl.cc compilation, as we need to
# pass -mlong-double-64.
@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc
diff --git a/libstdc++-v3/src/placeholders.cc b/libstdc++-v3/src/placeholders.cc
new file mode 100644
index 0000000..1d68bb7
--- /dev/null
+++ b/libstdc++-v3/src/placeholders.cc
@@ -0,0 +1,65 @@
+// std::placeholders -*- C++ -*-
+
+// 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "placeholders.cc must be compiled with -std=gnu++0x"
+#endif
+
+#include <functional>
+
+namespace std
+{
+ namespace placeholders
+ {
+ extern const _Placeholder<1> _1{};
+ extern const _Placeholder<2> _2{};
+ extern const _Placeholder<3> _3{};
+ extern const _Placeholder<4> _4{};
+ extern const _Placeholder<5> _5{};
+ extern const _Placeholder<6> _6{};
+ extern const _Placeholder<7> _7{};
+ extern const _Placeholder<8> _8{};
+ extern const _Placeholder<9> _9{};
+ extern const _Placeholder<10> _10{};
+ extern const _Placeholder<11> _11{};
+ extern const _Placeholder<12> _12{};
+ extern const _Placeholder<13> _13{};
+ extern const _Placeholder<14> _14{};
+ extern const _Placeholder<15> _15{};
+ extern const _Placeholder<16> _16{};
+ extern const _Placeholder<17> _17{};
+ extern const _Placeholder<18> _18{};
+ extern const _Placeholder<19> _19{};
+ extern const _Placeholder<20> _20{};
+ extern const _Placeholder<21> _21{};
+ extern const _Placeholder<22> _22{};
+ extern const _Placeholder<23> _23{};
+ extern const _Placeholder<24> _24{};
+ extern const _Placeholder<25> _25{};
+ extern const _Placeholder<26> _26{};
+ extern const _Placeholder<27> _27{};
+ extern const _Placeholder<28> _28{};
+ extern const _Placeholder<29> _29{};
+ }
+}