From c3c5e486808bc473d1642bb4ba84d80689c8fca2 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 9 Jul 2018 16:12:27 -0700 Subject: [PATCH] Fix test for availability of emplace_back. 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 | 5 +++++ gold/incremental.cc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 83df3d87571..eeb19e75bde 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2018-07-09 Cary Coutant + + * incremental.cc (Sized_incremental_binary::setup_readers): Use + emplace_back for C++ 11 or later. + 2018-07-06 Alan Modra * powerpc.cc: Include attributes.h. diff --git a/gold/incremental.cc b/gold/incremental.cc index 7558d14ff50..1199fe070fd 100644 --- a/gold/incremental.cc +++ b/gold/incremental.cc @@ -311,10 +311,10 @@ Sized_incremental_binary::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()) { -- 2.30.2