Skip to content

Compile error using Code::Blocks // mingw-w64 GCC 8.1.0 - "Incomplete Type" #1193

Description

@NickCNA
  • What is the issue you have?

Latest version of the single include (21st July 2018) fails to compile and throws a warning and error. The previous version used compiled perfectly with exactly the same compiler settings.

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

Update json.h; compile with mingw-w64 GCC 8.1.0

  • What is the expected behavior?

Successful compile, per previous versions.

  • And what is the actual behavior instead?

Compile warning: "_MSC_VER is not defined"
Compile error: has incomplete type where the type is std::stringstream.

Window 7 and 10; mingw-w64 GCC 8.1.0

  • Did you use a released version of the library or the version from the develop branch?

Develop (I've always used the develop branch).

The error seems to relate to this change:

From

template < typename ValueType, typename std::enable_if <
               not std::is_pointer<ValueType>::value and
               not std::is_same<ValueType, detail::json_ref<basic_json>>::value and
               not std::is_same<ValueType, typename string_t::value_type>::value and
               not detail::is_basic_json<ValueType>::value
#ifndef _MSC_VER  // fix for issue #167 operator<< ambiguity under VS2015
               and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
#endif
#if defined(JSON_HAS_CPP_17)
               and not std::is_same<ValueType, typename std::string_view>::value
#endif
               , int >::type = 0 >

to

template < typename ValueType, typename std::enable_if <
               not std::is_pointer<ValueType>::value and
               not std::is_same<ValueType, detail::json_ref<basic_json>>::value and
               not std::is_same<ValueType, typename string_t::value_type>::value and
               not detail::is_basic_json<ValueType>::value
#ifndef _MSC_VER  // fix for issue #167 operator<< ambiguity under VS2015
               and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value
#if defined(JSON_HAS_CPP_17) && _MSC_VER <= 1914
               and not std::is_same<ValueType, typename std::string_view>::value
#endif
#endif
               , int >::type = 0 >

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions