[Interest] MSVC 2013 Bug?

Igor Mironchik igor.mironchik at gmail.com
Thu Nov 12 21:05:37 CET 2015


Hi folks,

Is it a bug or feature?

class TextFileViewException
     :    public std::runtime_error
{
public:
     explicit TextFileViewException( const QString & what );
     ~TextFileViewException() throw();

     //! \return What happened as QString.
     const QString & whatAsQString() const;

private:
     //! What happened?
     QString m_what;
}; // class TextFileViewException

TextFileViewException::TextFileViewException( const QString & what )
:    std::runtime_error( what.toLocal8Bit() )
     ,    m_what( what )
{
}

TextFileViewException::~TextFileViewException() throw()
{
}

const QString &
TextFileViewException::whatAsQString() const
{
     return m_what;
}

This exception class compiles successfully with MSVC 2013 and Qt 5.5.1.

Look at this line:

std::runtime_error( what.toLocal8Bit() )

std::runtime_error() constructs from QByteArray... How it is possible?

-- 
Best Regards,
Igor Mironchik.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151112/9ae51a87/attachment.html>


More information about the Interest mailing list