Skip to content

Commit 094337b

Browse files
committed
Work around a bug in GCC 5-10
GCC 5-10 incorrectly complain about our nested classes being private. So, make them public.
1 parent 7e720a9 commit 094337b

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

include/boost/static_string/config.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,11 @@ using basic_string_view =
279279
#define BOOST_STATIC_STRING_USE_STD_FORMAT
280280
#endif
281281

282+
#if defined(__GNUC__) && (__GNUC__ >= 5) && (__GNUC__ <= 10) && !defined(__clang__)
283+
// Workaround for GCC complaining about nested classes being private.
284+
#define BOOST_STATIC_STRING_GCC_NESTED_CLASS_WORKAROUND public:
285+
#else
286+
#define BOOST_STATIC_STRING_GCC_NESTED_CLASS_WORKAROUND
287+
#endif
288+
282289
#endif

include/boost/static_string/static_string.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ class static_string_base
322322
using pointer = value_type*;
323323
using const_pointer = const value_type*;
324324

325+
BOOST_STATIC_STRING_GCC_NESTED_CLASS_WORKAROUND
326+
325327
struct size
326328
{
327329
class basic_static_string
@@ -388,6 +390,8 @@ class static_string_base<0, CharT, Traits>
388390
using value_type = typename Traits::char_type;
389391
using pointer = value_type*;
390392

393+
BOOST_STATIC_STRING_GCC_NESTED_CLASS_WORKAROUND
394+
391395
struct size
392396
{
393397
class basic_static_string

0 commit comments

Comments
 (0)