]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix test for availability of emplace_back.
authorCary Coutant <ccoutant@gmail.com>
Mon, 9 Jul 2018 23:12:27 +0000 (16:12 -0700)
committerCary Coutant <ccoutant@gmail.com>
Mon, 9 Jul 2018 23:12:27 +0000 (16:12 -0700)
Testing for the GCC version 5 or later isn't right, since C++ 11 support
wasn't enabled by default until later.  This patch tests the C++ standard
support directly instead of inferring it from the GCC version.

gold/
* incremental.cc (Sized_incremental_binary::setup_readers): Use
emplace_back for C++ 11 or later.

gold/ChangeLog
gold/incremental.cc

index 83df3d87571dfc1984de1c3a4b40665ee5e4a600..eeb19e75bdeb9e3f61e6f42c2ef063afdd34388f 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-09  Cary Coutant  <ccoutant@gmail.com>
+
+       * incremental.cc (Sized_incremental_binary::setup_readers): Use
+       emplace_back for C++ 11 or later.
+
 2018-07-06  Alan Modra  <amodra@gmail.com>
 
        * powerpc.cc: Include attributes.h.
index 7558d14ff506e14972c2bfb6b6d5adfe3e355ff8..1199fe070fdb995c89e9f84b2a6b74eb582d840a 100644 (file)
@@ -311,10 +311,10 @@ Sized_incremental_binary<size, big_endian>::setup_readers()
   for (unsigned int i = 0; i < count; i++)
     {
       Input_entry_reader input_file = inputs.input_file(i);
-#if defined(__GNUC__) && __GNUC__ < 5
-      this->input_entry_readers_.push_back(Sized_input_reader(input_file));
-#else
+#if __cplusplus >= 2001103L
       this->input_entry_readers_.emplace_back(input_file);
+#else
+      this->input_entry_readers_.push_back(Sized_input_reader(input_file));
 #endif
       switch (input_file.type())
        {