Re: [Boost-bugs] [Boost C++ Libraries] #12577: Null reference in pair.hpp triggers runtime warning with -fsanitize=undefined

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12577: Null reference in pair.hpp triggers runtime warning with -fsanitize=undefined
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-24 01:56:31


#12577: Null reference in pair.hpp triggers runtime warning with
-fsanitize=undefined
-------------------------------+------------------------
  Reporter: antoinep92@… | Owner: igaztanaga
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: container
   Version: Boost 1.62.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+------------------------

Comment (by eric_niebler):

 Why isn't this simply:


 {{{
 template <class T>
 struct static_constexpr {
     static constexpr T const value {};
 };
 template <class T>
 constexpr T const static_constexpr<T>::value;

 using piecewise_construct_t = std::piecewise_construct_t const &;

 namespace {
   piecewise_construct_t piecewise_construct =
     static_constexpr<std::piecewise_construct_t>::value;
 }
 }}}

 ??

 This code requires global constructors, which causes a warning on some
 compilers.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12577#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC