From cc79c1259c3134721bfff51311fa4fefe4efc542 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 3 Aug 2017 08:01:17 -0600 Subject: [PATCH] Adapt @asartori's patch to fix the correct problem. --- include/deal.II/base/function_parser.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/deal.II/base/function_parser.h b/include/deal.II/base/function_parser.h index 5170af931a..6a4accae91 100644 --- a/include/deal.II/base/function_parser.h +++ b/include/deal.II/base/function_parser.h @@ -328,11 +328,17 @@ private: /** * The muParser objects for each thread (and one for each component). We are - * storing shared_ptr so that we don't need to include the definition of + * storing a unique_ptr so that we don't need to include the definition of * mu::Parser in this header. */ - // std::unique_ptr does not compile with gcc-5.4 +#if TBB_VERSION_MAJOR >= 4 + mutable Threads::ThreadLocalStorage > > fp; +#else + // older TBBs have a bug in which they want to return thread-local + // objects by value. this doesn't work for std::unique_ptr, so use a + // std::shared_ptr mutable Threads::ThreadLocalStorage > > fp; +#endif /** * An array to keep track of all the constants, required to initialize fp in -- 2.39.5