Skip to content

Does not compile with Visual studio 2013 due to missing defaulted move constructor support #766

@pvaddina

Description

@pvaddina

Hi,
The code does not compile for VS 2013. I faced two issues:

  1. CMake generates incorrect project label for the project yaml-cpp. As a result VS 2013 ends up in the error:

error MSB3491: Could not write lines to file "yaml-cpp.dir\Debug\yaml-cpp.08AA9AF5.tlog\yaml-cpp $<IF:$BOOL:OFF,shared,static>.lastbuildstate". Illegal characters in path.

  1. Using a work around, i was able to compile the project but with errors. VS 2013 compiler does not support defaulted move constructors and defaulted destructors.

C2264: 'YAML::StreamCharSource::StreamCharSource' : error in function definition or declaration; function not called
C2610: 'YAML::BadConversion::~BadConversion(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::BadDereference::~BadDereference(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::BadFile::~BadFile(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::BadInsert::~BadInsert(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::BadPushback::~BadPushback(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::BadSubscript::~BadSubscript(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::Binary &YAML::Binary::operator =(YAML::Binary &&)' : is not a special member function which can be defaulted
C2610: 'YAML::Binary::Binary(YAML::Binary &&)' : is not a special member function which can be defaulted
C2610: 'YAML::EmitterException::~EmitterException(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::Exception::~Exception(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::InvalidNode::~InvalidNode(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::InvalidScalar::~InvalidScalar(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::KeyNotFound::~KeyNotFound(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::ParserException::~ParserException(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::ptr_vector &YAML::ptr_vector::operator =(YAML::ptr_vector &&)' : is not a special member function which can be defaulted
C2610: 'YAML::ptr_vector::ptr_vector(YAML::ptr_vector &&)' : is not a special member function which can be defaulted
C2610: 'YAML::RepresentationException::~RepresentationException(void) throw()' : is not a special member function which can be defaulted
C2610: 'YAML::SettingChanges::SettingChanges(YAML::SettingChanges &&)' : is not a special member function which can be defaulted
C2610: 'YAML::StreamCharSource::StreamCharSource(YAML::StreamCharSource &&)' : is not a special member function which can be defaulted
C2610: 'YAML::TypedKeyNotFound::~TypedKeyNotFound(void) throw()' : is not a special member function which can be defaulted
C2797: 'YAML::Directives::version': list initialization inside member initializer list or non-static data member initializer is not implemented

I fixed both the issues by:

  1. Not using a PROJECT_LABEL property for the yaml-cpp project in the CMakeLists.txt
  2. By implementing the move constructors to do element wise move and providing a default empty implementation for the destructors

The question is:

  • Did any one notice the issue ?
  • Can I deliver these changes ?

Thank you
Prakash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions